I am using jqgrid in my project.I have requirement that when user select row and click on edit button of inline toolbar control and modify any data in cell after that instead of click on Save button of inline toolbar control user click(select) any other row at that time.I want to show user message like
Wants to save/discard the modified data
if user click on Save button of message dialog then save the data otherwise discard the data.So please let me know how can I implement it.Till user don’t click on save or discard button don’t select the next row on which user click.
First of all you should use
restoreAfterSelect: false
option ofinlineNav
(if you useinlineNav
). Seconds you can usebeforeSelectRow
to implement the required behavior and to callsaveRow
orrestoreRow
depend on the user choice.The simplest implementation of
beforeSelectRow
could be the following:I used
confirm
method above. You can see the working code on the demo.Alternatively one can create asynchronous dialog using jQuery UI dialog for example. Then the code of
beforeSelectRow
could be the following:The corresponding demo is here.