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
2048
Manage igGrid "saveChanges" result
posted

Hi,

I'd like to know if it is possible to manage the result that controller action send bakc after a "saveChanges" igGrid called method.

My controller action ends with:

            JsonResult result = new JsonResult();
            Dictionary<string, bool> response = new Dictionary<string, bool>();
            response.Add("Success", true);
            result.Data = response;

            return result;

And I know that, if ("Success", true) everything goes right. But if I would like to have more info, or just catch ("Success", false), is there a way to get result in javascript section? Now I have (for example related to deleted row event):

    $("#grid1").live('iggridupdatingrowdeleted', function (event, ui) {
            $("#grid1").igGrid("saveChanges");
    });

If I put:

            result = $("#grid1").igGrid("saveChanges");

I can see that result is a HTMLTableElement object...is it right? Do you have some suggestions to let me understand how manage saveChanges result or just to manage a negative come back result?

Thank you,

 

Flavio

Parents
  • 24671
    Suggested Answer
    posted

    Hi Flavio,

    if you return a JsonResult, the response should be in Json format, and not HTML, could you paste parts of the response (or the whole response) ? 

    Other than that, if you'd like to can add any number of callbacks to notify you when the response from saveChanges arrives:

    $("#grid").data("igGrid").dataSource._addChangesSuccessHandler( <your handler>);

    there is also 

    $("#grid").data("igGrid").dataSource._removeChangesSuccessHandler( <your handler>);

    The parameters that will be passed to your function are: data, textStatus, jqXHR. 

    Hope it helps. Thanks,

    Angel

Reply Children