Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  10] [ 1]  / answers: 1 / hits: 23154  / 13 Years ago, tue, may 31, 2011, 12:00:00

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.


More From » jquery

 Answers
7

you 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.


[#91962] Sunday, May 29, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
danar

Total Points: 271
Total Questions: 94
Total Answers: 93

Location: Ecuador
Member since Thu, Jun 4, 2020
4 Years ago
danar questions
;