jqGrid v4.3.2
ie9
win7enterprise
I use the following code to generate subgrids:
http://www.trirand.com/blog/jqgrid/jqgrid.html β More β Grid as SubGrid
I do it and I have
Sub Level 1 OK
subcrisis of the 2nd level OK
subcrisis of the third level OK
4th level subgrid. It loads an OK subgate for each row of the 3rd Lvl sg, but it only displays the data of the first identifier of the third level row sg
When I check the developer tools, I see that the request always sends the identifier of the first row of the third sub-critique, I know how to add custom parameters using postData that I already tried, and also this answer from Oleg To postData for subgrid in jqgrid does not work? (this one does not work in my case, data is not added to the request)
I tried to return the rowdid from the following events, but with no luck, it still returns the identifier of the first row of the third subcrist, and thus, for each row in the third sub-series, the child subgram always returns the same.
subGridRowExpanded
Another strange behavior is that if I click on any line on a third-level subgrad, it will select only the first line.
No, using treegrid is not an option, sorry.
I'm going to associate the click event on the plus sign (first cell) of each row of the 3rd level subgrad and run expandSubGridRow, but the question remains, how can I get the rowid of the row that I clicked on the third level subgrad?
With best wishes and thanks, any help is greatly appreciated.
jQuery("#listsg11").jqGrid({ url:'server.php?q=1', datatype: "xml", height: 190, colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], colModel:[ {name:'id',index:'id', width:55}, {name:'invdate',index:'invdate', width:90}, {name:'name',index:'name', width:100}, {name:'amount',index:'amount', width:80, align:"right"}, {name:'tax',index:'tax', width:80, align:"right"}, {name:'total',index:'total', width:80,align:"right"}, {name:'note',index:'note', width:150, sortable:false} ], rowNum:8, rowList:[8,10,20,30], sortname: 'id', viewrecords: true, sortorder: "desc", multiselect: false, subGrid: true, caption: "Grid as Subgrid", subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; subgrid_table_id = subgrid_id+"_t"; $("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ url:"subgrid.php?q=2&id="+row_id, datatype: "xml", colNames: ['No','Item','Qty','Unit','Line Total'], colModel: [ {name:"num",index:"num",width:80,key:true}, {name:"item",index:"item",width:130}, {name:"qty",index:"qty",width:70,align:"right"}, {name:"unit",index:"unit",width:70,align:"right"}, {name:"total",index:"total",width:70,align:"right",sortable:false} ], subGrid: true, caption: "Grid as Subgrid", subGridRowExpanded: function(subgrid_id2, row_id2) { var subgrid_table_id2; subgrid_table_id2 = subgrid_id2+"_t"; $("#"+subgrid_id2).html("<table id='"+subgrid_table_id2+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id2).jqGrid({ url:"subgrid.php?q=3&id="+row_id2, datatype: "xml", colNames: ['No','Item','Qty','Unit','Line Total'], colModel: [ {name:"num",index:"num",width:80,key:true}, {name:"item",index:"item",width:130}, {name:"qty",index:"qty",width:70,align:"right"}, {name:"unit",index:"unit",width:70,align:"right"}, {name:"total",index:"total",width:70,align:"right",sortable:false} ], subGrid: true, caption: "Grid as Subgrid", subGridRowExpanded: function(subgrid_id3, row_id3) { var subgrid_table_id3; subgrid_table_id3 = subgrid_id3+"_t"; $("#"+subgrid_id3).html("<table id='"+subgrid_table_id3+"' class='scroll'></table></div>"); jQuery("#"+subgrid_table_id3).jqGrid({ url:"subgrid.php?q=4&id="+row_id3, datatype: "xml", colNames: ['No','Item','Qty','Unit','Line Total'], colModel: [ {name:"num",index:"num",width:80,key:true}, {name:"item",index:"item",width:130}, {name:"qty",index:"qty",width:70,align:"right"}, {name:"unit",index:"unit",width:70,align:"right"}, {name:"total",index:"total",width:70,align:"right",sortable:false} ] }); } }); } }); } });