Created
August 12, 2013 09:55
-
-
Save xcooper/6209598 to your computer and use it in GitHub Desktop.
overwrite jqGrid ajax mechanism, send json to backend instead of submitting a form.
datatype should be "json" "xml" "script"
postData is data you wanna send
ajaxGridOptions is ajax configuration of jQuery
serializeGridData is a function having only one argument which is postData you provided, it should return a Serialized data(e.g. String)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.grid.jqGrid("setGridParam", { | |
serializeGridData: self.serializeData, | |
url: self.executionUrl, | |
datatype: "json", | |
ajaxGridOptions: { | |
cache: false, | |
contentType: "application/json", | |
processData: false, | |
type: "POST" | |
}, | |
postData: { | |
reportId: self.reportId, | |
userCondition: self.userCondition.toJSON(), | |
criterionType: self.getCriterionTypeValue() | |
} | |
}); | |
self.grid.trigger("reloadGrid"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment