Pagination / Four-button / Option / Conditionally Display/Suppress text labels
Pagination / Four-button / Option / Conditionally Display/Suppress text labels
![netaisllc](https://secure.gravatar.com/avatar/173cfbfa3ef0cc7d19d5bd045b2eab5b/?default=https%3A%2F%2Fvanillicon.com%2F173cfbfa3ef0cc7d19d5bd045b2eab5b_200.png&rating=g&size=120)
Hi Allan,
I was wondering if you have ever fielded this request:
When using 4-button pagination, I'd like to communicate FIRST, LAST, NEXT and PREV with icons.
Is there a way to tell the plugin to refrain from injecting the equivalent text strings?
(Yeah, I know I can target the anchor tags with Jquery and omit the text - shown below - but that feels like a bad surgeon wielding an axe.)
[code]
// See if full number pagination has been elected
var _p = $('.dataTables_paginate.paging_full_numbers');
// Remove Next/Previous text
if ( _p.length ) {
// Reselect to get only anchors without spans which hold page numbers
// That is, we want only First, Previous, Next and Last.
$('.dataTables_paginate.paging_full_numbers > a').text("");
};
[/code]
I was wondering if you have ever fielded this request:
When using 4-button pagination, I'd like to communicate FIRST, LAST, NEXT and PREV with icons.
Is there a way to tell the plugin to refrain from injecting the equivalent text strings?
(Yeah, I know I can target the anchor tags with Jquery and omit the text - shown below - but that feels like a bad surgeon wielding an axe.)
[code]
// See if full number pagination has been elected
var _p = $('.dataTables_paginate.paging_full_numbers');
// Remove Next/Previous text
if ( _p.length ) {
// Reselect to get only anchors without spans which hold page numbers
// That is, we want only First, Previous, Next and Last.
$('.dataTables_paginate.paging_full_numbers > a').text("");
};
[/code]
This discussion has been closed.
Replies
The solution is to use, in the table configuration object, the Language Configuration options like so:
[code]
oLanguage: {
oPaginate: {
"sFirst": "",
"sLast": "",
"sNext": "",
"sPrevious": ""
}
},
[/code]
This results in the same outcome but is much less brutal. :)
Allan