
子表格也是一个jqgrid,你可以像 *** 作主表格一样 *** 作子表格的subGridRowExpanded: function(subgrid_id, row_id) {// we pass two parameters// subgrid_id is a id of the div tag created whitin a table data// the id of this elemenet is a combination of the "sg_" + id of the row// the row_id is the id of the row// If we wan to pass additinal parameters to the url we can use// a method getRowData(row_id) - which returns associative array in type name-value// here we can easy construct the flowingvar subgrid_table_id, pager_id;subgrid_table_id = subgrid_id+"_t";pager_id = "p_"+subgrid_table_id;$("#"+subgrid_id)html("<table id='"+subgrid_table_id+"' class='scroll'</table<div id='"+pager_id+"' class='scroll'</div");jQuery("#"+subgrid_table_id)jqGrid({url:"subgridphpq=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}],rowNum:20,pager: pager_id,sortname: 'num',sortorder: "asc",然后子表格的 *** 作就是jQuery("#"+subgrid_table_id)jqGrid('getGridParam','selarrrow');
subGridRowExpanded: function(subgrid_id, row_id) {
// we pass two parameters
// subgrid_id is a id of the div tag created whitin a table data
// the id of this elemenet is a combination of the "sg_" + id of the row
// the row_id is the id of the row
// If we wan to pass additinal parameters to the url we can use
// a method getRowData(row_id) - which returns associative array in type name-value
// here we can easy construct the flowing
var subgrid_table_id, pager_id;
subgrid_table_id = subgrid_id+"_t";
pager_id = "p_"+subgrid_table_id;
$("#"+subgrid_id)html("<table id='"+subgrid_table_id+"' class='scroll'</table<div id='"+pager_id+"' class='scroll'</div");
jQuery("#"+subgrid_table_id)jqGrid({
url:"subgridphpq=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}],
rowNum:20,
是要把selarrrow的所以id传给服务器端么?定义onclickSubmit函数时返回所以的id就行,如
onclickSubmit:function(re,postd){
var gr = jQuery("#list")getGridParam('selarrrow');
return {ids:gr};
}
在服务端接收ids参数的值就行,值的形式是1, 2, 3, 4 这样的然后自己到服务器进行处理就行
以上就是关于jqgrid subGridRowExpanded出来的子表格如何获取选中的行全部的内容,包括:jqgrid subGridRowExpanded出来的子表格如何获取选中的行、谁知道jqgrid subGridRowExpanded出来的子表格如何获取选中的行、在jqgrid 中 selarrrow获得的多行数据ID怎么传到editurl等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)