I can’t find an example of a Perspective table with Add and Delete row buttons so I’m rolling my own (with great difficulty).
Root
- FlexContainer
- btnDeleteRow
- Table
The btnDeleteRow onActionPerformed script is
try:
params = {'id':self.parent.parent.getChild("Table").props.selection.data[0].id}
system.db.runNamedQuery('Config/queryConfigRowDelete', params)
self.parent.parent.getChild("Table").refreshBinding(‘props.data’)
except:
pass
The table binding is to a named query, type = Update Query, with command
DELETE FROM myTable WHERE id = :id
The output console reports the following. (Line breaks mine for legibility.)
ERROR com.inductiveautomation.ignition.client.util.gui.
ErrorUtil - Unable to run action 'component.onActionPerformed' on subViews/viewConfig@D/root/FlexContainer/btnDeleteRow:
code could not be compiled.
com.inductiveautomation.ignition.common.GenericTransferrableException:
SyntaxError: (u"no viable alternative at character '\u2018'", ('<function:runAction>', 7, 54,
u'\t\tself.parent.parent.getChild("Table").refreshBinding(\u2018props.data\u2019)\n'))
Can anyone see what I can’t?
Many thanks. Oh - and is there an example Add / Delete table row anywhere?