Folks,
I am attempting to get insert/update/delete/ working on my grid. I have filled out the details of the grid in javascript and provided the updateurl that needs to be called When I edit a record and hit return or go to the next record, the server is not calling the method. I have used the non-ignite versions of the grid in asp but not in MVC. Any help would be greatly appreciated. I have uploaded the code.. see attached
Hello,
Thank you for contacting Infragistics!
The reason for this is the grid does batch updating. So it will only commit/save when commanded to. If you want you can set autoCommit to true and this will commit changes to the local/client data. Then whenever you want to save the data you would call saveChanges to save the changes to the datasource/trigger the update url:
https://www.igniteui.com/help/api/2016.2/ui.iggrid#options:autoCommit
https://www.igniteui.com/help/api/2016.2/ui.iggrid#methods:saveChanges
If you don’t want autoCommit you will have to call commit then call saveChanges:https://www.igniteui.com/help/api/2016.2/ui.iggrid#methods:commit
Thanks this works but I have a few questions
1) Why have autoCommit when you have to call the "savedChanges" from within one of the events anyways?
2) Which events should the "saveChanges" be called from... editRowEnded?
3) What is the preferred method by infragistics to render the control? (using Razor or using javascript) Is there a net benefit to either one?
4) The razor approach emits the table table for you. Is there away to stop this? I would like to put the javascript at the end of the page and the html at the top (performance reasons). The emitting of table creates a problem... especially if you are using layouts with script sections in the MVC page.
I like to have autoCommit on more as a personal preference as this way the data will be commited to the local datasource before any paging happens or other behaviors that need this to happen. This way if saveChange is instead moved to be called at a later time it won’t cause any issues. Calling saveChanged in editRowEnded will work. If you are doing row adding/deleting you will also want it in the –ed events for adding and deleting.
Using Razor or JavaScript is personal preferences. The Razor/MVC wrappers will compile down to JavaScript when you run it either way. As for the Razor out putting the sample there isn’t a way to prevent that. If that is a concern of yours I would recommend using JavaScript instead.