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;
}
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");
Hope it helps. Thanks,
Angel
Angel,
Sorry I didn't reply on this sooner - was a bit bogged down with other screens for my system ;-).
I am nor specifically changinf AutoCommit - so will check this out when I get back to this screen.
Thanks for the response though...
Graham
you're right: autoCommit set to true automatically update the changes locally, while saveChanges method looks at UpdateUrl and update the backend.
But there is an other problem related to the refresh. My example is this: suppose to have a grid of products, with n columns. One of these is the ProductID (not visible in the grid). Adding a new row, setting all the columns values, correctly calls controller action, which correctly writes on db, returning a positive result (I also can see immediately the new row, because of the autocommit true option).But ProductID value is generated by db side. What's the problem with this? If I immediately try to delete the just added row, it is impossible, because as ProductID the grid has an ID matching with rowId or something like that, but it has not he real one generated by the db.A possible solution is to refresh the page just after adding the new row. In this case a refresh will take up data from db, matching grid primary key with right ProductId.
Of course my question is: how to refresh all the page after a "saveChanges" calling?
Thansk,
Flavio