Hi I have a jqgrid with a subgrid which calls into a servlet. I am sending some data to the servlet using POST but the same data doesn't get sent when the call for the subgrid is made. This is my 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});
So how can I postData also to the subgrid servlet? is there any way to specify subgridPostData? Thanks.
I find the suggestion with subgridPostData
good. Probably you should post the corresponding feature request in the trirand forum.
Now you can implement the same feature itself using serializeSubGridData event. Just define a new jqGrid parameter with the name which you like, for example subgridPostData
and use it inside of your serializeSubGridData event handler:
$("#testsTable").jqGrid({
...
subGrid: true,
subGridUrl: "GetCurrentStatusServlet",
subgridPostData: {foo: "bar"},
serializeSubGridData: function(postdata) {
return $.extend(postdata, this.p.subgridPostData);
},
...
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With