var gridObj = $("#Grid").ejGrid("instance");//get the gridObject
gridObj.ignoreOnPersist(["actionBegin", "actionComplete"]);// set the properties that are to be prevented from being persisted
|
Thanks Alan!
Is there a way to set those as defaults? My concern with that is if I set that after the page has loaded and the grid setup via the unobtrusive JavaScrip it will have already loaded the previous event handlers. Ideally I'd like a way to either set this via RAZOR or set the default values for this.
I ended up finding a solution after a lot of trial and error and by inspecting the Grid object in a debugger. As mentioned I have many grids and I didn't want to have to add a method on document load for every single one of them. I found I could modify the prototype for the Grid and add what I needed to the _ignoreOnPersist array. Doing it this way, every grid that gets created ignores the correct items by default. I don't have the code in front of me but it should be:
ej.Grid.prototype._ignoreOnPersist = ej.Grid.prototype._ignoreOnPersist.concat([/*Items that need to be ignored by default*/]);