jqgrid中子网格的postData不起作用?

嗨我有一个带有子网格的jqgrid,它调用了一个servlet。 我正在使用POST向servlet发送一些数据,但是在调用子网格时不会发送相同的数据。 这是我的JS:

$("#testsTable").jqGrid({ mtype: "POST", url: "GetCurrentStatusServlet", postData: {buildPath :"C:\\Test\\01"}, datatype: "xml", colNames:['TestCase Name', 'Last Update', 'Status'], colModel:[ {name:'name',index:'name', width:90}, {name:'lastupdate',index:'lastupdate', width:100}, {name:'status',index:'status', width:80, align:"right"} ], rowNum:10, autowidth: true, rowList:[10,20,30], pager: $('#pager1'), sortname: 'id', viewrecords: true, multiselect: true, caption: "Tests", sortorder: "desc", subGrid: true, subGridUrl : "GetCurrentStatusServlet", subGridModel: [ { name: ['TestCase Name', 'Last Update', 'Status'], width : [100, 200, 80], params: ['name']}] }).navGrid('#pager1',{edit:false,add:false,del:false}); 

那么我怎样才能将postData也发送到子网格servlet? 有没有办法指定subgridPostData? 谢谢。

我发现subgridPostData的建议很好。 您可能应该在trirand论坛中发布相应的function请求。

现在,您可以使用serializeSubGridData事件实现相同的function。 只需使用您喜欢的名称定义一个新的jqGrid参数,例如subgridPostData ,并在serializeSubGridData事件处理程序中使用它:

 $("#testsTable").jqGrid({ ... subGrid: true, subGridUrl: "GetCurrentStatusServlet", subgridPostData: {foo: "bar"}, serializeSubGridData: function(postdata) { return $.extend(postdata, this.p.subgridPostData); }, ... });