Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery 1.6 jgrid pagging ejemplo

onPaging: function() {
    $(this).setGridParam({datatype: 'json'}).triggerHandler("reloadGrid");
},
loadComplete: function (data) {
    var $this = $(this);
    if ($this.jqGrid('getGridParam', 'datatype') === 'json') {
        // because one use repeatitems: false option and uses no
        // jsonmap in the colModel the setting of data parameter
        // is very easy. We can set data parameter to data.rows:
        $this.jqGrid('setGridParam', {
            datatype: 'local',
            data: data.rows,
            pageServer: data.page,
            recordsServer: data.records,
            lastpageServer: data.total
        });

        // because we changed the value of the data parameter
        // we need update internal _index parameter:
        this.refreshIndex();

        if ($this.jqGrid('getGridParam', 'sortname') !== '') {
            // we need reload grid only if we use sortname parameter,
            // but the server return unsorted data
            $this.triggerHandler('reloadGrid');
        }
    } else {
        $this.jqGrid('setGridParam', {
            page: $this.jqGrid('getGridParam', 'pageServer'),
            records: $this.jqGrid('getGridParam', 'recordsServer'),
            lastpage: $this.jqGrid('getGridParam', 'lastpageServer')
        });
        this.updatepager(false, true);
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: leetcode reverse interger solution 
Javascript :: find every character string match JavaScript 
Javascript :: only return inner hits from nested objects 
Javascript :: mapa gratis leaflet 
Javascript :: leap year javascript 
Javascript :: jquery random color array 
Javascript :: how to move an array over one 
Javascript :: button color change loop in react 
Javascript :: check if object is empty js 
Javascript :: node blank string 
Javascript :: nested array generator for js 
Javascript :: myModal 
Javascript :: argument and parameter 
Javascript :: Confirm the EndingPassed--Javascript 
Javascript :: react-map-multidimensional-array 
Javascript :: how to reload page with router next js 
Javascript :: Fibonacci perticular position in javascript 
Javascript :: jboss-ejb-client.propeties exampe de configuration 
Javascript :: Search products by includes in javascript 
Javascript :: javascript get each element count / occurrences / frequency from a list 
Javascript :: Apply for new operator 
Javascript :: get image height Jimp nodejs 
Javascript :: show tempdata in javascript 
Javascript :: variable local and global 
Javascript :: The slice reducer for key "books" returned undefined during initia 
Javascript :: Mandatory Parameter Shorthand javascript 
Javascript :: convert javascript to typescript online converter 
Javascript :: JavaScript call url many times 
Javascript :: foreach doesnt return 
Javascript :: Finding the longest word in a string 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =