pager:pager_id, jsonReader:{ root:rows, page:page, 总计:总计, 记录:记录, 重复项:false, Id:0 }, sortorder:asc, viewrecords:true, autowidth:true, multiselect:false }); 解决方案 (#+ subgrid_id).html( ); v ar dataFromTheRow = jQuery('#grid')。jqGrid('getRowData',row_id); (#+ subgrid_table_id) .jqGrid({ url:/ MyApp / OrdersDetailsSubgridData?tablename =+ dataFromTheRow, 数据类型:'json', mtype:'GET', colNames:['Column Names'], colModel:[ {名称:COLUMN_NAME,索引:COLUMN_NAME,关键字:true} ], rowNum :20, 寻呼机:pager_id, jsonReader:{ root:rows, 页: page, 总计:总计, 记录:记录, repeatitems:false, Id:0 }, sortorder:asc, viewrecords:true, autowidth:true, multiselect:false }); I have made a grid thats working sine and subgrids with it. The problem is that I want to send the table name (data of row) in my url to action method but i just have row_id and i dont know how to get data from it. I used the getRowData function but its not working. I dnt know where i am wrong. I done something like subGridRowExpanded: function (subgrid_id, row_id) { var subgrid_table_id, pager_id; subgrid_table_id = subgrid_id + "_t"; pager_id = "p_" + subgrid_table_id; $("#" + subgrid_id).html(""); var dataFromTheRow = jQuery('#grid').jqGrid('getRowData', row_id); $("#" + subgrid_table_id).jqGrid({ url: "/MyApp/OrdersDetailsSubgridData?tablename=" + dataFromTheRow, datatype: 'json', mtype: 'GET', colNames: ['Column Names'], colModel: [ { name: "COLUMN_NAME", index: "COLUMN_NAME", key: true } ], rowNum: 20, pager: pager_id, jsonReader: { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, Id: "0" }, sortorder: "asc", viewrecords: true, autowidth: true, multiselect: false }); 解决方案 ("#" + subgrid_id).html(""); var dataFromTheRow = jQuery('#grid').jqGrid('getRowData', row_id);("#" + subgrid_table_id).jqGrid({ url: "/MyApp/OrdersDetailsSubgridData?tablename=" + dataFromTheRow, datatype: 'json', mtype: 'GET', colNames: ['Column Names'], colModel: [ { name: "COLUMN_NAME", index: "COLUMN_NAME", key: true } ], rowNum: 20, pager: pager_id, jsonReader: { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, Id: "0" }, sortorder: "asc", viewrecords: true, autowidth: true, multiselect: false }); 这篇关于如何从jq子网格中的row_id获取rowdata的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 11-02 08:15