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
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
Flavio,
I use the following in a few places where I need to force a page refresh :
function reloadPage() { location.reload(true);}
Hope this helps you....
Graham
It is something that can help me.
Thanks!
Hi Flavio,
do you need any more help on this? Thanks
No sorry Angel,
I did not read your question.
For now it is all right with grid refresh ;-)
Thanks to all !!!