For each value in table

Hi everyone!

I am trying to add currency format to some table values, I am almost there but I am only getting the first row value, I tried using the for each loop but still I am only getting the first row displayed…

Any ideas?

Where are you only getting the first row? I don’t understand from your code what you are trying to do. Please provide more information.

Hi Yisrael,
Thanks for the reply, I am importing a function (fmt) to format numbers into currency mode, I have used it already into separate items but I am not sure how to do it to be applied in two columns of a table that display numbers.

The table has 4 columns (date, total, amount paid, type of payment) I need the columns total and Amount paid which have numeric values to be formatted as currency.

So with the code above shown I am successfully getting the formatted values of total and amount paid as currency but the table is only displaying the first row, however that table has 6 rows of info to be displayed.

Does that make sense to you?
Thanks in advance

@torijin Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

@yisrael-wix https://editor.wix.com/html/editor/web/renderer/edit/c6c27b79-593d-4d81-bae2-0efdb55b5ac0?metaSiteId=ab0a4573-47cb-4e39-8442-85a1f16fe343&editorSessionId=5d895374-d453-4d80-98ba-7c02736bc8e6&referralInfo=my-account

The page is the dynamic page called Pacientes (ID)

Thanks!

@torijin The table is empty. It has no rows so nothing happens when the cargosTABLE_viewportEnter() handler runs. Try putting a console.log() like this:

let allRows = $w("#cargosTABLE").rows;
console.log(allRows);

You’ll see that allRows is empty. You can’t format empty. :upside_down_face:

@yisrael-wix Thanks but the table is not empty, it gets populated from a collection called cargos, what I mean is that the code is only displaying one item instead all the corresponding items for that query…