Pagination's First and Previous buttons are not disabled on page #1
Pagination's First and Previous buttons are not disabled on page #1
macimagic
Posts: 1Questions: 0Answers: 0
Pagination's "First" and "Previous" buttons are not disabled on page #1
STEPS TO REPRODUCE:
1. create dataTable with this code:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"sPaginationType": "full_numbers"
} );
} );
[/code]
You can also see table example here: http://datatables.net/examples/basic_init/alt_pagination.html
2. Go to page #1 by clicking the "First" button in the pagination section.
3. See the status of the "First" and "Previous" buttons, they are active and clickable.
4. Go to the last page by clicking "Last" button.
5. See the status of the "Last" and "Next" buttons, they are active and clickable.
EXPECTED RESULT:
1. Buttons "First" and "Previous" have a disabled state for page #1
2. Buttons "Last" and "Next" have a disabled state for last page
ADDITIONAL INFO:
DataTables v1.7.6
[code]
_oExt.oStdClasses = {
/* Two buttons buttons */
"sPagePrevEnabled": "paginate_enabled_previous",
"sPagePrevDisabled": "paginate_disabled_previous",
"sPageNextEnabled": "paginate_enabled_next",
"sPageNextDisabled": "paginate_disabled_next",
"sPageJUINext": "",
"sPageJUIPrev": "",
/* Full numbers paging buttons */
"sPageButton": "paginate_button",
"sPageButtonActive": "paginate_active",
"sPageButtonStaticDisabled": "paginate_button", // <<<<<<<< THE PROBLEM MIGHT BE HERE
"sPageFirst": "first",
"sPagePrevious": "previous",
"sPageNext": "next",
"sPageLast": "last",
[/code]
STEPS TO REPRODUCE:
1. create dataTable with this code:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"sPaginationType": "full_numbers"
} );
} );
[/code]
You can also see table example here: http://datatables.net/examples/basic_init/alt_pagination.html
2. Go to page #1 by clicking the "First" button in the pagination section.
3. See the status of the "First" and "Previous" buttons, they are active and clickable.
4. Go to the last page by clicking "Last" button.
5. See the status of the "Last" and "Next" buttons, they are active and clickable.
EXPECTED RESULT:
1. Buttons "First" and "Previous" have a disabled state for page #1
2. Buttons "Last" and "Next" have a disabled state for last page
ADDITIONAL INFO:
DataTables v1.7.6
[code]
_oExt.oStdClasses = {
/* Two buttons buttons */
"sPagePrevEnabled": "paginate_enabled_previous",
"sPagePrevDisabled": "paginate_disabled_previous",
"sPageNextEnabled": "paginate_enabled_next",
"sPageNextDisabled": "paginate_disabled_next",
"sPageJUINext": "",
"sPageJUIPrev": "",
/* Full numbers paging buttons */
"sPageButton": "paginate_button",
"sPageButtonActive": "paginate_active",
"sPageButtonStaticDisabled": "paginate_button", // <<<<<<<< THE PROBLEM MIGHT BE HERE
"sPageFirst": "first",
"sPagePrevious": "previous",
"sPageNext": "next",
"sPageLast": "last",
[/code]
This discussion has been closed.
Replies
[code]"bJQueryUI": true[/code]
Thanks.
.first paginate_button.paginate_button_disabled{background-color: #f4f4f4; border: 1px solid #f4f4f4;}
or whatever color you want to indicate disabled and do the same for the last..
Does that help?
Thank you for replying, but no, it didn't resolve my issue.
I'm now noticing that the active and hover states aren't working either... which leads me to believe I'm missing an entire class declaration.
I just noticed the comment from Allan in the header of the demo_table_jui.css file:
[quote]
* Common issues:
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is
* no conflict between the two pagination types. If you want to use full_numbers pagination
* ensure that you either have "example_alt_pagination" as a body class name, or better yet,
* modify that selector.
[/quote]
Unfortunately, that didn't help either with I added a class name to the body tag.
Am I missing something else similar to that?
This solution is in two parts (page change and css change):
PART 1:
You'll need to add this class to the dataTables.css file (or however you want to add the class):
// start here
.paginate_button_disabled {
border: 1px solid #aaa;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 2px 5px;
margin: 0 3px;
color: #999 !important;
background-color: #ff0000;
}
// end here
Notice that I left all the original parms in this class and set the background color to a loud red --- just so you can definitely see how it works. :) Just change the background color to whatever you like.
PART 2:
In your page load js, you'll need to add this line:
$.fn.dataTableExt.oStdClasses.sPageButtonStaticDisabled = "paginate_button_disabled";
Hope this helps all of you searching for this solution to the problem!