I have an Asp.Net MVC app using jqGrid. Can I send the Model that is used to populate a lot of my ui controls(checkboxes, radio buttons, etc) to the server(controler action method). I would like to send this Model to the server instead of reading ui control by ui control. Can this be done?
var myGrid = jQuery("#list").jqGrid({
url: '/Data/GridData/',
datatype: 'json',
mtype: 'POST',
colNames: ['Year', 'Overall %'],
colModel: [
{ name: 'Year', index: 'Year', width: 80, align: 'center' },
{ name: 'overallHarvestPercent', index: 'overallHarvestPercent', width: 80, align: 'center'}],
postData: { contactId: jQuery('#contactId').val() },
pager: jQuery('#pager'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'id',
sortorder: "desc",
viewrecords: true,
imgpath: '',
caption: 'Harvest Data Results'
});
Specify your Model as the data type for the Controller Action’s Parameter.