最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Add additional param to post data using jqGrid when adding new row with modal form - Stack Overflow

programmeradmin3浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 9

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)

  1. 暂无评论