As per the API docs:-
rows
Sets or gets the table’s row data.
Description
Setting the rows property sets the data of the table’s rows. A table’s data is stored as an array of objects where each object represents a row in the table.
But when I get a table’s row data, the array of objects is converted into an array of arrays as below
my code:-
var rows = [{ item: “Item Description” , quantity: 4 , amount: “$ 44” , },
{ item: “Item2 Description” , quantity: 5 , amount: “$ 55” , } ]
$w( "#table1" ).rows = rows;
var tableRows = $w( “#table1” ).rows;
tableRows.forEach((item) => { console.log(Object.entries(item)) });
rows.forEach((item) => { console.log( “ROWS:” + Object.entries(item)) });
console.log:-
(4) [Array(2), Array(2), Array(2), Array(2)]
(4) [Array(2), Array(2), Array(2), Array(2)]
ROWS:item,Item Description,quantity,4,amount,$ 44
ROWS:item,Item2 Description,quantity,5,amount,$ 55