craneleeon
craneleeon

Reputation: 23

how to use serializeRowData option with editRow method in jqgrid to post a json data to server

how to use serializeRowData option with editRow method in jqgrid to post a json data to server ?

Upvotes: 2

Views: 4271

Answers (1)

Justin Ethier
Justin Ethier

Reputation: 134255

serializeRowData may be used to take a row's data and serialize it to (for example) JSON or XML prior to POSTing it to the server. Here is an article that provides an overview of its usage. Basically, here is example code to use it along with json2.js (from json.org) to serialize data to JSON prior to being submitted:

jQuery("#tableid").jqGrid({
 ...
 serializeRowData: function(postdata){
    return { x01: JSON.stringify(postdata) };
 }
 ...
});

Does that help?

Upvotes: 5

Related Questions