我正在扩展 jqgrid 默认选项:
$.extend(
$.jgrid.defaults,
{
datatype: "json",
jsonReader:
{
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
cell: "cell",
id: "id"
},
height: 'auto',
rowNum: 20,
recordtext: 'record',
loadtext: 'loading',
imgpath: 'path',
viewrecords: true,
multiselect: true,
postData: { random: Math.random() },
rowList: [10, 20, 30, 50],
beforeRequest: function() { OnBeforeRequestFunct(); },
onPaging: function() { OnPagingPersonalize(); },
gridComplete: function() { if(editedRowIds.length > 0)
refreshSelection();
}
}
);
因此,当从网格触发触发事件 beforeRequest 时,我需要将调用者 jqgrid id 传递给 OnBeforeRequestFunct()。
最佳答案
那么您想传递网格 DOM 元素的 ID 吗?您尝试过吗:
OnBeforeRequestFunct(this.id);
关于jquery - 从事件触发器获取jqgrid DOM ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1566326/