I'm using version 18.1.18. I have a table on a view which calls the onEditCellCommit and onSelectionChange component events. I am running the exact same script on both. It works perfectly on onEditCellCommit, but I get "maximum recursion depth exceeded (Java StackOverflowError)" error on line 3 when called by onSelectionChange. Here is the script:
I'm a special case, PGriffith, a special case. I saw this case where you said it was a bug, but I figured it was handled since it was so old Tag.configure max recursion depth exceeded The weird thing is it works fine in onEditCellCommit
Ok, using event.selectedRow, event.selectedColumn doesn't cause an error, but I don't see how to get what I changed the cell value to. The event.data is the data before the edit. It kinda makes sense because my selected cell is now a different cell. Is there a way for me to commit the edit when a user selects a different cell. Can I fire the onEditCellCommit somehow?
Messing around with this problem, I don't see any way to gain this functionality from the selection change event that you were originally trying to use.
However, I was able to gain this functionality by adding a custom property to the table called editString. Then, using the onEditCellStart event, I could clear the value from the editString prop using self.props.editString = ''. I could then keep track of what was typed using the onKeyPress event and the following code:
To make the editString commit when another cell was selected, I ran the normal onEditCellCommit script from the onEditCellCancel event using the custom editString property for the value instead of the event's value.
Unfortunately, this approach only works if the entry is completely new because if a small edit is made to the existing text, all that gets saved when another cell is selected is the text typed during the small edit. Therefore, to ensure that the entire string doesn't get replaced by a partial entry, you would need to clear the text at the beginning of the edit. Sadly, the table doesn't have a clear text on entry option, so to get this functionality, you would have to render a view with a text field that is configured to do this.
...and if you're rendering a text field view in the column, you should probably just follow through with the change script message suggested in the previous post.