Scripting a property change in a table

I have a table that I would like to be able to edit cells and have those new values written to the tags that are bound to said cell. As I understand tables in Ignition are not bi-directional so I need a property change script to pass the edited values. This seems like a it would be a common issue so does anyone out there have a script for editing tables and having those values recorded in the PLC?

You’ll have to write to the SQLTag (and, thus, the PLC) through the cellEdited event.

Yes I understand where the script goes but what I want to know is how to write it so it determines which cell was edited and writes the new value to the appropriate tag.

It is a common issue, and they cover it in the “help” files.

“Tutorials and helpful tricks” section —> “Creating and editable table in Ignition”

I followed this to do what you’re asking. Was pretty easy.

An editable table is probably what you are after, you can read up on it here

inductiveautomation.com/supp … igniti.htm

There is an example at the bottom of the page you can use as well.

This worked but I am still having trouble writing to the tag that was bound to the cell I have edited. How can I get my script to identify the tag bound to the edited cell and then write the newValue to that cell specific tag? I am currently using cell update binding to write tag values to the table.

This is the code that I have used to successfully write to one tag no matter which cell was edited.

[code]row = event.row
col = event.column
colName = event.source.data.getColumnName(col)
value = event.newValue
id = event.source.data.getValueAt(row, 0)

system.tag.write(“MainProgram/Hand_1_Set”, value)[/code]

Sorry for the delay in reply. I was able to get this working with this script in a cellEdited script on the table component. This is the script I used

row = event.row tag = event.source.data.getValueAt(row, 0) system.tag.write(tag, event.newValue)

Pretty basic. Column 0 of the table I made hidden and is where I stored my tagpath. I did use a cell update binding for the column I used for the tag value.