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
1150
igGrid save changes completed event
posted

I have a grid that does the batch update by doing $('#grid').igGrid('saveChanges'). In my controller that handles the save, I followed the sample code to return JsonResult whether it succeed or fail.

Is there an event that the grid dispatch once the save completed ? if so, how do I access that json result status ? I want to do some more logic once the save is done only when the save finished successfully.

Parents
  • 6279
    Verified Answer
    posted

    Hi Jeffrey,

    I'm afraid that there is no public API function available for this operation.
    However, there's an internal method of the igDataSource that you can use without any problems: _addChangesSuccessHandler.

    Here's an example of how to get the status of the request after it has arrived:

    <script type="text/javascript">
        $(function () {
            $("#Grid1").live("iggridrendered", function (evt, ui) {
                $("#Grid1").data("igGrid").dataSource._addChangesSuccessHandler(function (data, textStatus, jqXHR) {
                    alert("Request status: " + textStatus);
                });
            });
        });
    </script>
    



    I'm also attaching an MVC3 sample demo'ing the solution.

    Cheers,
    Borislav 

    t72670.zip
Reply Children