获取jqgrid有多条行数据

获取jqgrid有多条行数据,第1张

选中一行可以用这样获得:

var selectedId = $("#manager_list")jqGrid("getGridParam", "selrow");

var rowData = $("#manager_list")jqGrid("getRowData", selectedId);

var selectedIds = $("#manager_list")jqGrid("getGridParam", "selarrrow");

先通过这一句获得所有选中的ids, 然后根据ids得到所有选中的记录

colNames=$("#UsersGrid")jqGrid('getGridParam','colNames')colModel=$("#UsersGrid")jqGrid('getGridParam','colModel') 楼主去学下调试工具,firebug或者chrome的开发工具,看结构就知道了

表格也是一个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 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,

pager: pager_id,

sortname: 'num',

sortorder: "asc",

然后子表格的 *** 作就是jQuery("#"+subgrid_table_id)jqGrid('getGridParam','selarrrow');

以上就是关于获取jqgrid有多条行数据全部的内容,包括:获取jqgrid有多条行数据、jqGrid如何通过点击单元格的值来获取当前单元格的行标题与列标题、怎么获取jqgrid表格的选中行等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/10077532.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存