user3576420
user3576420

Reputation: 1

How can I set the total pages number for the jqx-grid in my js controller programatically?

I get the result count from the server side and this count should be the total pages count.

The count is received correct and it should now be set as the total pages number.

How to accomplish this?

Upvotes: 0

Views: 203

Answers (1)

regis charles
regis charles

Reputation: 36

It is possible to set the total page count in the before processing function of the source that you are defining. like this

 var source =
        {
            datatype: "json",
            datafields: [
                 { name: 'studentId' },
                 { name: 'studentName' },
                 { name: 'Address' },
                 { name: 'City' },
                 { name: 'Country' }
            ],
            url: 'remote server',

            beforeprocessing: function (data) {
                //refer the below example                  
                source.totalrecords = data[0].TotalRows;
            },

        };

Upvotes: 1

Related Questions