how can i prevent the user to close the webapplication (x in internet explorer) without saving the changes in the ultrawebgrid?
elke
I got it. It can be done in the following way. The key is updating the readyState flag to false in AfterExitEditModeHandler.
//////////////////////////
var readyState = true;
window.onbeforeunload = checkProgressState;
function checkProgressState(){
if (!readyState){
message = "WARNING: Your data is not saved, if you choose to exit your information may be lost.";
return message;
}
else
{
readyState = true;
function HandleExitEditMode(gridID, cellID) {
readyState = false;
///////////////////
If you want this alert to be suppressed in SaveButtonClick, then OnClientClick of that button, update the readyState variable to true.
Hi,
Thanks for the solution. But it doesnt talk anywhere about the UltraWebGrid. How do I find out whether the contents of the grid are changed? I have grid like excel spreadsheet.
Hey,
I am also in the same situation. I need to prompt/save the grid data before exiting. Any clues on how to do it?
try it, but it only worked in IE:
<html><head> <body onBeforeUnLoad="clean_exit(this)" > something else........