Page Number not showing on select "ALL" from dropdown
Page Number not showing on select "ALL" from dropdown
pankajnpatel
Posts: 4Questions: 0Answers: 0
Datatable not showing page number while I select option "ALL" from dropdown...
I have added below option with Datatable.
$('#myTable').dataTable(
{
"bAutoWidth":false,
"bPaginate": true,
"sPaginationType": "full_numbers",
"bInfo": false,
"bFilter": true,
"bSort": true,
"sScrollX": "100%",
"sScrollXInner": "150%",
"sScrollY": "230",
"bLengthChange": true,
"sDom": 'rt<"bottom"p>',
"iDisplayLength": 10,
"bProcessing": true,
"oLanguage": {
"sSearch": "Search within results:"
},
"aLengthMenu": [[10, 20, 40, 80, 160, -1] , ["10/page", "20/page", "40/page", "80/page", "160/page" , "All"]],
"fnDrawCallback": function ( oSettings ) {
if (this.parent().find("div.paging_full_numbers").find('span:not([class])').text() == '' ){
this.parent().find("div.paging_full_numbers").find('span:not([class])').html("1");
}
}
});
In above configuration I have added "fnDrawCallback" to display page "1" number in pagination.... When I remove scroll option from above configuration then it display "1" pagenumber.
Also why its not displaying page number "1" when I select "ALL" option from dropdown?
Any one can help me to resolve this problem?
I have added below option with Datatable.
$('#myTable').dataTable(
{
"bAutoWidth":false,
"bPaginate": true,
"sPaginationType": "full_numbers",
"bInfo": false,
"bFilter": true,
"bSort": true,
"sScrollX": "100%",
"sScrollXInner": "150%",
"sScrollY": "230",
"bLengthChange": true,
"sDom": 'rt<"bottom"p>',
"iDisplayLength": 10,
"bProcessing": true,
"oLanguage": {
"sSearch": "Search within results:"
},
"aLengthMenu": [[10, 20, 40, 80, 160, -1] , ["10/page", "20/page", "40/page", "80/page", "160/page" , "All"]],
"fnDrawCallback": function ( oSettings ) {
if (this.parent().find("div.paging_full_numbers").find('span:not([class])').text() == '' ){
this.parent().find("div.paging_full_numbers").find('span:not([class])').html("1");
}
}
});
In above configuration I have added "fnDrawCallback" to display page "1" number in pagination.... When I remove scroll option from above configuration then it display "1" pagenumber.
Also why its not displaying page number "1" when I select "ALL" option from dropdown?
Any one can help me to resolve this problem?
This discussion has been closed.
Replies
Allan
When I select length from dropdown like 10,20,40..... its working fine and pagination control also displaying page numbers....
But when I select "ALL" from dropdown then its not displaying default selected page "1".
Could you please help me to resolve this issue and how will be useful the fnPagingInfo to solve this?
Allan
I have added below condition in my jquery datatable js file. It working fine now for me....
Before changes :
iEndButton = iPages;
After changes :
iEndButton = (iPages) < 0 ? 1 : (iPages);
I have updated this code in function "fnUpdate" @ line# 449. I am getting this issue only if I use "sScrollX" & "sScrollY"
* File: jquery.dataTables.js
* Version: 1.8.2
Thanks for flagging this up!
Allan
I have used table control on many pages in my current application and this application is on final stage. It's suitable to use new version right now because of some minor changes can be make more QA work.....
Could you please tell me those changes if possible? So I can add it in existing used datatable version. Because of version 1.8.2 is working fine for me.....
Allan