How to refresh Power Table?

Hi All
I wonder what might be the reason that power table does not refresh after selecting a row and deleting the entry? The only way to refresh table is to change screens which is not good.
I have my own project but delete button is base on tutorial documentation and named query.
https://docs.inductiveautomation.com/display/DOC80/Simple+Database+Editor
system.db.refresh(event.source.parent.getComponent(‘Power Table’), “data”)

Is this Vision or Perspective?

One option for both is to set the query to polling.

system.db.refresh is used to refresh SQL bindings in Vision. Your data property has the SQL Query binding? If not, this won’t work.

To refresh in Perspective, you need to do something like self.refreshBinding("props.data") where self is the table itself. Whatever your chain is to the table, might be something like self.parent.getSibling()....getSibling("Power Table").refreshBinding("props.data").

Again though, make sure you are refreshing whatever actually has the SQL binding. If your table data property (in vision) is not a SQL query, then you must do the system.db.refresh() on whatever has the SQL Query binding that your table.data is pointing to.

2 Likes

Despite the truly terrible namespace, system.db.refresh in Vision will re-evaluate any binding, not just query bindings. Same for refreshBinding() in Perspective; while it generally makes the most sense for query bindings, any binding type can be refreshed.

2 Likes

I understand that refresh can be used on any binding. What I meant was for situations like I have where I have a tree component, and an invisible table component (used for the .propertiesLoading so I can show when the tree is being refreshed visually). The tree items are a property reference to the table data. When I was newer to Ignition, to refresh the tree initially what I had done was system.db.refresh("Tree", "items"), however what I needed to do was system.db.refresh("Table", "data") to refresh the Tree items.

2 Likes

Thanks for great help. Now i understand why it did not work - i had a query behind opening screen and also behind the button to populate the power table but nothing connected to the data property. Since i added “select from the view…” to the data property even if its not polling at all the power table data is refreshed properly after deleting the row.
I am happy :slight_smile:

1 Like