Editable rows in Power Table

I am hoping to have power table that allow the user in runtime to add or delete rows and edit the values of each cell, basically so they have their own excel sheet to work with. Is this possible with the power tables?

Yes, with a fair amount of scripting. The key is to not allow the table’s data binding to poll. Script it, if necessary. Cell updates replace the table’s dataset with the edit, as would scripted row insert & delete. the latter are best done with external buttons.

If you want a fixed set of columns, it may be convenient to use a database table to hold per-user last-saved values.

1 Like

I see what you are saying, right now I have a Power Table with a tag binding to a tag dataset. If I edit a cell and hit enter it just reverts back to the original value. I already set the data property to be bidirectional and if I edit the table from within the properties window, it works. Any idea why I can’t edit the table through the component itself?

Because a “change” for a dataset is a new dataset. While you can use .setValueAt() to directly change a cell in a dataset, it isn’t a recognized change anywhere else in Ignition. (And won’t ever be–Datasets are supposed to be immutable.) Which is why system.dataset.setValue() returns a new dataset. In your cell update event, assign that back to your table’s data property.

1 Like