Hello, I am having a problem trying to figure this error out. The error is:
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File "<function:runAction>", line 4, in runAction
TypeError: 'com.inductiveautomation.ignition.gateway.datasource.BasicStreamingDataset' object is unsubscriptable
line 4 being “self.props.data[event.row][event.column] = valueToSet”
This simple script works while the table is not filtered by dropdowns; however, when filtered it will not allow the onCellEditCommit to replace the previous value. I’m assuming this is because the filtered results column/row doesn’t match up with the database column/row. The filter for the dropdowns are a simple “Select * from database where line = :line, area = :area” etc. The full table onCellEditCommit code is this:
#allows cell to be edited
valueToSet = event.value
self.props.data[event.row][event.column] = valueToSet
#sets edited value immediately -- otherwise have to click elsewhere to set
self.props.selection.data[0].TrainingLevel = valueToSet
I figure I better include one of my dropdowns’ change scripts as well. This is the example of the line dropdown for filtering.
Line = self.props.value
system.db.runNamedQuery("TrainingLine", {"Line" :Line})
returnedData = system.db.runNamedQuery("TrainingLine", {"Line" :Line})
self.parent.parent.getChild("Table").props.data = returnedData
After the onCellEditCommit script, I have an update button that the user will click to insert this updated value to the database. I am trying to find an alternate way of using the onCellEditCommit so that it works with the filtered dropdowns. Any tips or advice is greatly appreciated.