jqgrid嵌套子网格第4级子网格总是返回子网格的第一个rowid
jqGrid v4.3.2
IE9
win7enterprise
我正在使用以下代码生成子网格:
http://www.trirand.com/blog/jqgrid/jqgrid.html – >高级 – >网格作为SubGrid
我这样做,我有
第1级子网格确定
二级子网格确定
第3级子网格确定
第4级子网格它为第3个Lvl sg的每一行加载子网格OK,但是它只显示第3个Lvl sg的第一行id的数据
当我检查开发人员工具时,我看到请求总是发送第三个子网格的第一行的id,我知道如何使用我已经尝试过的postData附加自定义参数,以及来自zggrid中子网格的 Oleg K postData的答案不工作? (这个在我的情况下不起作用,数据没有添加到请求中)
我试图从以下事件返回rowdid但没有运气,它仍然返回第三个子网格的第一行id,因此,对于第三个子网格上的每一行,子子网格总是返回相同的。
subGridRowExpanded //always returns first row id of the third grid onSelectRow //doesn't fire if we click the + icon for expanding the subgrid beforeSelectRow //doesn't fire at all
另一个奇怪的行为是,如果我单击第三级子网格上的任何行,它只选择第一行。
不,抱歉,使用treegrid不是一个选项。
我正在考虑在第3级子网格的每一行的加号图标(第一个单元格)上绑定一个click事件并触发expandSubGridRow,但问题仍然存在,如何获取我点击第三级的行的rowid 子网格 ?
致以最诚挚的问候和感谢,非常感谢任何帮助。
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("
"); 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("
"); 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("