Hello,
Is it possible to implement an edit behavior that automatically commits changes when an input cell loses focus? I have tried to implement this myself, but when manually calling commit the grid appears to discard any changes made. I have simulated this behavior in a JSFiddle which you can find at http://jsfiddle.net/2ga7gm0d/
Is this the wrong way to implement that kind of behavior? Or is there a better, more efficiënt way of achieving the result I am looking for? Maybe a solution that also covers simular functionality of asking the user if he wants to leave the current page if there are uncommited changes in the grid?
Kind Regards
Hello Michael,
Thank you for posting in the community.
By design, if you have autmCommit set to true and editMode is set to cell the grid will commit the changes automatically. If you comment the code that handles the blur event for the editor your sample it works as expected.
The modified sample could be found at: http://jsfiddle.net/2ga7gm0d/1/
If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me with more clarifications of what you are trying to achieve.
I hope you find this information helpful.
Please let me know if you have any additional questions regarding this matter.
Vasya,
I think you misunderstood my intention! The blur handler was there to make sure that when the user clicks out of the cell he was editing, the grid automatically commits any changes made. (if no invalid input was present in the cell) I know the autoComplete setting partially fulfills my needs, because it makes sure any changes made will be saved automatically when I enter another cell or tab, but I want the same behavior when he clicks on another element. (!= the grid) As you can see in my original JSFiddle when you edit a cell and then click out of the grid, I try to invoke this behavior by manually calling commit, but the grid appears to rollback my changes.