Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
459
save changes on exiting the application
posted

how can i prevent the user to close the webapplication (x in internet explorer) without saving the changes in the ultrawebgrid?

elke

Parents
No Data
Reply
  • 508
    posted

    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.

Children
No Data