Sorting option of 10 not working after using iDisplayLength
Sorting option of 10 not working after using iDisplayLength
hgsadhrakiya
Posts: 17Questions: 5Answers: 0
I used iDisplayLength for define the Number of rows to display on a single page.
But when I select the first option of Sorting "10", It not works, while other options works fine.
The First option works fine, If I select it after selecting any another option.
So, let me know the steps for solve this.
Thanks:)
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page], if you can't provide a link to your own page can be found here.
Thanks,
Allan
Just use this code:
$(document).ready( function () {
var table = $('#example').DataTable();
"iDisplayLength": 5000
} );
And select 10 on dropdown, It will not change to 10.
http://live.datatables.net/hukaseku/1/edit
I'm not sure I see the issue. There is no "5000" option in the list. Use
lengthMenu
if you want to show that option.Allan
Just go to the link: http://live.datatables.net/hukaseku/1/edit
And click on dropdown and select 10.
You will see all 57 rows while it should show only 10 rows.
This is the issue.
You should not be using "iDisplayLength" in this case if you wish to use the "lengthMenu" Allan linked to.
Taken from http://legacy.datatables.net/ref "iDisplayLength" -- sets the number of rows to be displayed on a single page using pagination. As you can see this is legacy and static, requiring user custom function to override and make it dynamic.
"lengthMenu" is the replacement for "iDisplayLength", "bLengthChange", and "bPagination" in latest DataTable.
Yes, but there is no change in the value of the select list since it is default 10 (since the actual number used for the page length is not in the list). If you used the
lengthMenu
option to include 5000 in the menu it would work just fine.I'm afraid I don't consider this a bug but rather a misconfiguration.
Allan