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.
Thanks for the quick reply. Tried it just now, and it works perfectly.
Thanks,
Jeffrey
Hello jAndika,
Follow the suggested by Borislav approach and let us know if it works in your scenario.
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