In cell edit is there a way to stop the submit event.
What we are trying to do, when user enters a value in the cell, we popup a dialog box with choices for the user, if the user clicks cancels – it should cancel the cell edit If user click is ok or any other choices- then it should post to server.
Anyway we try with beforeSubmitCell, request is sent to the server, is there a way to prevent this
Any help would be appreciated
Kris
jgGrid customer
This topic was modified 9 years, 1 month ago by krisreddy.
I tried the following simple example with javascript alert
if popups dialog – if click ok, posts to server if click cancel – return to cell in edit mode
In first case the build in javascript confirm function stop the execution of everything into the window. As per definition we have :
“The confirm box takes the focus away from the current window, and forces the browser to read the message. Do not overuse this method, as it prevents the user from accessing other parts of the page until the box is closed.”
With other words the script wait for the input and depending on the click it continues (save) or not (stay)
In second case we have a JavaScript dialog. This dialog act as ajax – the popup display and the script continues to be executed and since noting is returned in onSubmitEvent we suppose it is true and the save is done.
One possible solution is to return false on this event, but when the user click save in the dialog you will need to save the cell using saveCell method but with onSubmit event false. The tricky part is set this event to null before save and and back after it is saved.