bLengthChange Only Partially Works

bLengthChange Only Partially Works

machineghostmachineghost Posts: 9Questions: 0Answers: 0
edited May 2013 in General
I'm having a strange issue with DataTables' length change menu that I'm hoping someone can help me out with. I have a table with 23 rows, and I initialize DataTables on it with the following options:

{"aaSorting":[],"bFilter":false,"bInfo":true,"bLengthChange":true,"bPaginate":true,"bProcessing":true,"bRetrieve":true,"bScrollCollapse":true,"bSort":true,"aoColumns":[{"sType":"html"}],"aLengthMenu":[[10,25,50,100,-1],[10,25,50,100,"All"]],"bServerSide":true,"iDisplayStart":0,"oLanguage":{"sEmptyTable":"No saved queries have been shared with you."},"sPaginationType":"full_numbers"}

If I click on page 2, I see results 11-20, and if I click on page 3 I see rows 21-23, as expected. If I change the length change menu, the text changes to "Showing 1 to 10 of 23 entries" or "Showing 1 to 23 of 23 entries" as expected.

But here's the weird part: when the table first loads, or if I go to page 2/3 and then back to page 1, I see all 23 of my results. It's like DataTables just throws the pagination stuff out the window, but only for the table rows and only on page 1. And the length changer doesn't do anything at all except change the "Showing X of Y" text.

Has anyone ever seen DataTables do something like this, and if so were you able to solve it?

P.S. I tried setting an iDisplayLength, but all it affects is the initial value of the length change drop-down. So if I set it to 10, the length menu starts on 10, but I still see 23 rows.

Replies

  • machineghostmachineghost Posts: 9Questions: 0Answers: 0
    Nevermind, I found the problem. It seems this table (through editing by multiple devs) has become partly AJAX-based and partly HTML-based. I strongly suspect that once I clean that up everything else will fix itself.
This discussion has been closed.