I have a requirement to Edit the perspective Table cell. The table is SQL table.I have done that by writing the event scripts on EditCellCommit. After edit I need to press the enter to store the value in the cell. Now I want to commit the cell if I clicked outside or another cell. Is that achievable?
Create a custom view for the table column and apply it to the table using the table column viewPath property. Create a parameter to the view named rowData, then place a TextField in that view with its value bound to view.params.rowData.tankNo. Add an onBlur handler to the TextField that runs the query to update the database, and then calls system.perspective.sendMessage('refresh-table'). Add a message handler for refresh-table (or whatever you call it) on the table that invokes self.refreshBinding("props.data").
Note that the cell will then always be rendered as a TextField, unless you do what I do and create a label for it, and toggle their views (use onClick on the label to make the TextField appear, and use the onBlur handler to switch back to showing the label).
I’m interested in this too but it’s not worth applying views to every column in all my tables.
onEditCellCommit is great when the user hits [Enter].
Testing with other events like onKeyPress, onRowClick, onComposition* and even change script events to the editingCell column and row properties don’t have a way to capture the uncommitted value.