Add an extra parameter to send data using jqGrid when adding a new row with a modal form

I need to add an extra dynamic parameter to jqGrid data POSTwhen I add a new record with a modal form.

I tried:

$('#table').setPostData({group: id});
$('#table').setPostDataItem('group', id);
$('#table').setGridParam('group', id);

and nothing happened.

+5
source share
2 answers

you can use editData editGridRow . In most cases, you use editGridRow directly, but using Navigator. In this case, you can define editData as part prmEditor prmAdd navGrid :

$('#table').jqGrid('navGrid','#pager',
                   {/*navGrid options*/},
                   {/*Edit options*/
                       editData: {
                           group: function() {
                               return id;
                           }
                       }
                   }
});

: serializeEditData, onclickSubmit beforeSubmit. .

+10

POST jqGrid

$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

( jqGrid) .

+8

All Articles