Probably the best way to do this is to use a hidden form field:
<input type="hidden" name="gridData" value="" />
Then you must fill in the field with column data before submitting the form. You can either do this by updating the field as grid data, or by calling the JavaScript function when the button is pressed to submit the form (and calling form submit from this function).
To write grid data to a hidden field, you can call getRowData in each row of the grid sequentially and add data for each row to the array. Or maybe there is a better way. For example, is there a new data option that might work? In any case, if you have grid data, you can use json2.js to serialize the data in JSON format:
JSON.stringify( myGridData );
Then on the server, you can decode JSON from this hidden field and process it accordingly.
source share