I need to add additional dynamic parameter to jqGrid's POST
data when I'm adding new record with modal form.
I tried:
$('#table').setPostData({group: id});
$('#table').setPostDataItem('group', id);
$('#table').setGridParam('group', id);
and nothing worked out.
I need to add additional dynamic parameter to jqGrid's POST
data when I'm adding new record with modal form.
I tried:
$('#table').setPostData({group: id});
$('#table').setPostDataItem('group', id);
$('#table').setGridParam('group', id);
and nothing worked out.
Share Improve this question asked May 31, 2011 at 7:40 TeneffTeneff 32.2k13 gold badges75 silver badges104 bronze badges2 Answers
Reset to default 9you can use editData parameter of the editGridRow method. In the most cases you use editGridRow not directly, but using Navigator. In the case you can define editData as the part of prmEdit
or prmAdd
of the navGrid:
$('#table').jqGrid('navGrid','#pager',
{/*navGrid options*/},
{/*Edit options*/
editData: {
group: function() {
return id;
}
}
}
});
One more option is the serializeEditData, onclickSubmit or beforeSubmit method. See details here and here.
You can add additional dynamic parameter to jqGrid's POST data
$j("#listsg11").jqGrid({
url: "/summary_reports",
postData: {department:"value1", score_r1:"value2", designation:"value3" },
mtype: 'POST',
datatype: "xml",
height: 250,
width: '100%', .... and so on
This method appends values with default params (used by jqGrid) with call.