Hi all
I have a page with a Dataset, connected to a Collection, and a Table, connected to the Dataset.
I am trying to have the following behavior : when a row in the Table is clicked :
- Update data value in the row
- Update corresponding row in Collection
My understanding was that there was a 2-way link between Table, Dataset and Collection, meaning I thought an update to a value in the table would automatically trigger an update to the Dataset, which itself would trigger an update to the Collection.
But that does not seem to be the case :
- Table data is updated
- But Dataset value do not change, neither does the row in the Collection
- Event the table.onDataChange handler is not called.
Thanks for you insights.
Here’s code from my page :
// Here I update the Table content
$w("#table2").onRowSelect( (event, $w) => {
let rowData = event.rowData;
rowData["status"] = "Done";
// Table is updated all right, it shows on the page
$w("#table2").updateRow (rowIndex, rowData);
} );
// KO, not triggered
$w("#dataset2").onItemValuesChanged( (itemBeforeChange, updatedItem) => {
console.log("OH - dataset2.onItemValuesChanged");
} );
// KO not triggered
$w("#table2").onDataChange( (event, $w) => {
console.log ("OH - table2.onDataChange");
});
// OK triggered
$w("#dataset2").onCurrentIndexChanged( (index) => {
console.log ("OH - dataset2.onCurrentIndexChanged");
} );