从事件触发器获取jqgrid DOM ID

时间:2009-10-14 13:45:12

标签: jquery jqgrid

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

1 个答案:

答案 0 :(得分:3)

所以你想传递网格DOM元素的ID?你试过了吗?

OnBeforeRequestFunct(this.id);