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
200
How to refresh grid after updating ??
posted

Hi,

I am updating a grid, data gets changed to italics on pressing 'Done'.

Then I press a button on the page which calls :

    function saveChanges() {

        $("#SiteGrid").igGrid("saveChanges");

        return true;

    }

This calls the controller action correctly (sometimes fails with Add Row though....investigating).
Action return takes me back to the View BUT the grid still shows the italics - ie it doesn't refresh.
Tried returning true or false in the above code - makes no difference,
Tried different returns from the action :
            return View(); // RedirectToAction("Sites");
Both still do not refresh ??.
Can anyone tell me how to make the grid refresh with the updated data upon return please ??.
Thanks
Graham

Parents
  • 24671
    Suggested Answer
    posted

    Hi,

    before calling saveChanges, you should invoke commit (you're seeing the italics style since you probly have  the autoCommit option set to false). What commit does is commit the changes locally, to the data source. saveChanges invokes the Url and lets you update your backend.

    $("#SiteGrid").igGrid("commit");

    $("#SiteGrid").igGrid("saveChanges");

    Hope it helps. Thanks,

    Angel

Reply Children