jQuery + jqgrid postData overriding default values

后端 未结 1 1159
北海茫月
北海茫月 2021-01-15 06:13

so I have grid which I set some defaults on like so...

defaults: {
    datatype: \"json\",
    mtype: \"POST\",
    autowidth: true,
    height: \'100%\',
           


        
相关标签:
1条回答
  • 2021-01-15 06:28

    you have to add a extra option to your options called serializeGridData see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events

    so you should do something like this:

    $('#grid').jqGrid({
        url: 'url',
        ....
        serializeGridData: function(postData) {
          var newPostData = $.extend(postData, {
            extraParam: 'EXTRA-PARAM-VALUE'
          });
    
          // newPostData now is (_search=false&nd=1324619663709&rows=100&page=1&sidx=&sord=asc&extraParam=EXTRA-PARAM-VALUE)
          return $.param(newPostData);
        }
    });
    
    0 讨论(0)
提交回复
热议问题