1. The behavior you unexpectedly encountered -
inside of onEditCellCommit on setting self.props.data[row][column] = "Hello World" did not update
2. The behavior you were expecting to see - again, one line is fine.
expected to update the value of self.props.data[row][column] to "Hello World"
3. A list of the steps you took that exposed the issue
my grid data was created with an array of dicts
right click on grid "configure events"
select onEditCellCommit
def runAction(self, event):
"""
Fired when a user has effectively committed an edit on a cell via return or
enter key press.
Arguments:
self: A reference to the component that is invoking this function.
event: An object with the following attributes:
column (int | str): The column of the edited cell.
row (int): The unique row index as it is represented in the source
data. Also known as the row ID.
rowIndex (int): The row index as it is represented in the current
visible data.
value (bool | int | float | str): The committed value.
"""
#the default value in this case is: center
self.props.data[event.row][event.column] = "Hello World"
system.perspective.print(self.props.data[event.row][event.column])
expected this to print "Hello World" it printed "center"
expected a error if there is a error received no log or error
4. The answer
after long debugging I discovered the reason
def runAction(self, event):
"""
Fired when a user has effectively committed an edit on a cell via return or
enter key press.
Arguments:
self: A reference to the component that is invoking this function.
event: An object with the following attributes:
column (int | str): The column of the edited cell.
row (int): The unique row index as it is represented in the source
data. Also known as the row ID.
rowIndex (int): The row index as it is represented in the current
visible data.
value (bool | int | float | str): The committed value.
"""
currentConfigTableData = self.props.data
changedRow = {}
for column in currentConfigTableData[event.row].items():
if column[0] == event.column:
column[1] = event.value
system.perspective.print(column)
changedRow.update({column})
this does throw an error currentConfigTableData[event.row].items() is a list of tuples
if this is the case I would want
self.props.data[event.row][event.column] = "Hello World"
to throw an error as well stating that is the case and not flow though without an error
edit: formatting