Paging oddity with large server side dataset

Paging oddity with large server side dataset

vinnythevikingvinnytheviking Posts: 2Questions: 0Answers: 0
edited October 2011 in General
Hi first of all thanks for a fantastic product. You've done a great job on it.

Now for my question.

I'm using server side processing and have 137000 records at the moment.

I have a default page size of 20.

On initial load the page shows correct "Showing 1 to 20 of 137,944 entries". When I click "next" it shows "Showing 0201 to 2,020 of 137,944 entries" This is obviously not right. I can't page again after this is shown. expect click "first" to take me to the first page.

Any ideas ?

Thanks

Vinny

Replies

  • GregPGregP Posts: 500Questions: 10Answers: 0
    Have a look at the JSON being returned. Assuming you have done no searches/filtering on the data set, both iTotalRecords and iTotalDisplayRecords should be 137000. If that's not the case, you've found your culprit. If that *is* the case, paste up your initialization and we'll have a look-see. :-)
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    edited October 2011
    set your page size as an integer, not a string

    [code]
    "iDisplayLength": 20 // good
    "iDisplayLength": "20" // bad
    [/code]

    allan's code should cast that to int, but it seems that the string is being used

    for 1 through 20, it seems the code is using "+" on strings and ints, which casts ints to string

    instead of 01 the "20" gets shoved in there to make 0"20"1 => "0201"
    instead of 20, the "20" gets appended or something
  • vinnythevikingvinnytheviking Posts: 2Questions: 0Answers: 0
    Thanks for the replies. Fbas you're right the page numbers were passed as strings. I solved this earlier but never got back on here till now. Your explanation helps a lot because I was wondering how it got to the 0201 value

    Thanks again

    Vinny
This discussion has been closed.