Get DQ ID jqgrid from event triggers

I am expanding the default jqgrid options:

$.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(); 
                                 }
    }
);

So, I need to pass the id of the calling jqgrid to OnBeforeRequestFunct () when the beforeRequest trigger event is fired from the grids.

+3
source share
1 answer

So you want to pass the identifier of the DOM grid element? You tried:

OnBeforeRequestFunct(this.id);
+3
source

Source: https://habr.com/ru/post/1720076/


All Articles