jQWidgets Forums

jQuery UI Widgets Forums Grid Pagination count incorrect

This topic contains 1 reply, has 1 voice, and was last updated by  Nigel 10 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Pagination count incorrect #68160

    Nigel
    Participant

    I and trying to get server side pagination to rework again. It was working, but I’ve done something and the javascript is now using the actual rows to do it’s pagination count.

    On the server I query the number of rows, store that in TotalRows, then add the pagination LIMIT, pull those rows and pass back to the app.

    The data back from the server correctly has:

    [{"TotalRows":18,"Rows":[{"id":9,"page_number":""... etc

    and the Rows array correctly has 10 rows (based on the pagination choice).

    I have my dataSource and adapter are currently set up like this:

    	var dataSource = {
    	...
    	    beforeprocessing : function(data) {
    		    if (data != null) {
    		    	logger("beforeProcessing() got totalRows = '" + data[0].TotalRows + "'");
    			    dataSource.totalrecords = data[0].TotalRows;
    		    }
    	    },
    	...
    	};
    
    	var dataAdapter = new $.jqx.dataAdapter(dataSource, {
    		downloadComplete: function(data) {
    		    if (data != null) {
    		    	logger("downloadComplete() got totalRows = '" + data[0].TotalRows + "'");
    			    dataSource.totalrecords = data[0].TotalRows;
    		    }
    		}
    	});
    

    My console correctly shows:

    beforeProcessing() got totalRows = '18'
    downloadComplete() got totalRows = '18'
    

    BUT the pagination stuff says 1-10 of 10. If I select 20 in the dropdown there is no server round trip either.

    What else can I look at to find out what I have done to break this?

    Thanks

    ps, I have looked at the examples and I’m still non-the-wiser as I am trying to use server side filtering, sorting, pagination and editing

    Pagination count incorrect #68163

    Nigel
    Participant

    Doh!!! It seems I accidentally deleted this:

    	virtualmode: true,
    	rendergridrows: function (params) {
    		return params.data;
    	},
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.