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
825
saveChangesErrorHandler not firing
posted

I'm having trouble getting saveChangesErrorHandler to be called when (for example) the I send a bad HTTP PUT request to the server.

         features : [ {
            name : 'Updating',
            editMode: "cell",
            startEditTriggers: "dblclick,F2",
            showDoneCancelButtons : true,

           saveChangesErrorHandler : function (jqXHR, textStatus, errorThrown) {
                alert("An error occurred while saving the changes: " + textStatus);
            },
            saveChangesSuccessHandler : function (data) {
                alert("Changes saved.");
            },

            <etc>

I see an alert from saveChangesSuccessHandler after a successful save, but never from the error handler. Similarly, a breakpoint in the error handler is never hit.

I tried pasting the handlers above to a sample project that Infragistics sent me for an unrelated issue, and got the exact same behavior. So it's presumably something silly like a typo, but I compared the lines to the docs and I'm not seeing the problem.

Thanks!

Parents
  • 3995
    Offline posted

    Hello Matthew Diamond,

     saveChangesErrorHandler is used when an error occurs during the saving of the data.

     

    An option in the igGrid "updatingUrl" can specify an ActionResult which handles the processing(saving) the data on the server. And saveChangesErrorHandler will be fired if an error occurs during that handling. So if you want to trigger that event you can try throwing an error in the updatingUrl ActionResult.

     

    If you want to fire some custom errors you can use this approach(http://stackoverflow.com/a/4235168)

Reply Children