Writing to a table's data[key: value] triggers an onSelectionChange event

This behaviour is causing me a problem in an application.

  • Selecting a cell opens a popup where the value is entered.
  • Clicking the popup's OK button saves the value in the database and updates the cell. (I'm not refreshing the binding as it can cause the row to move depending on the sort order.) The popup is then closed by the same script.
  • After the popup closes it pops up again caused by the onSelectionChanged event.

Q1: Is this expected behaviour?
Q2: How would I work around it to prevent the popup opening again? I could keep track of the previous cell selection and test in the onSelectionChanged event and exit if it's the same cell. Any other ideas?

I read 'onSelectionChange' as meaning any change to the selection prop of the table. Changing the value of the data in the selected row will therefore change the data key of the selection prop.

You could probably as you say keep track of the previous cell selection and add some logic to the event script to only open the popup on cell selection change.