从事件触发获取jqgrid DOM ID

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


有人吗?或者至少告诉我如何做到这一点的概念。 - jmav
1个回答

3

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

OnBeforeRequestFunct(this.id);

谢谢,我之前使用 console.log(this) 进行了测试,它只返回了“{}”,所以我没有看到 d 的内部内容 :)再次感谢! - jmav

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接