我有以下网格:
$(function(){
$("#poGrid").jqGrid({
url:'URL',
datatype: 'json',
mtype: 'GET',
colNames:[],
pager: '#poPager',
rowNum:10,
rowList:[10,20,30],
sortname: 'orderID',
sortorder: 'ASC',
jsonReader : { repeatitems: false },
viewrecords: true,
gridview: true,
caption: ' ',
multiselect: true,
height: "100%",
colModel :[
{name:'orderID', label:'Order ID', width:80, align: 'center'},
{name:'orderName', label:'Order Name', width:250},
{name:'countTotal', label:'Count Total', width:80},
{name:'orderTotal', label:'Order Total', width:80},
{name:'orderDate', label:'Order Date', width:100}
],
onSelectRow: function(id){
var grid = jQuery('#poGrid');
var sel_row = grid.jqGrid('getGridParam', 'selrow');
var sel_id = grid.jqGrid('getCell', sel_row, 'orderID');
setOrderIDs(id,sel_id);
}
});
我只是想弄清楚在我运行该setOrderIDs
函数之前是否选择了触发 onSelectRow 的行。如果它是由取消选择触发的,我不想运行该功能。
对此的任何帮助都会很棒。
谢谢!