我正在扩展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);