开发者

Add additional param to post data using jqGrid when adding new row with modal form

I need to add additional dynamic parameter to jqG开发者_运维问答rid'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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜