How do you update the Page length button caption?
How do you update the Page length button caption?
Hi,
regarding this
https://datatables.net/extensions/buttons/examples/initialisation/pageLength.html
How can you update the button caption?
I tried both
"lengthMenu": [
[10,20,50,100,200,400],
[10,20,50,100,200,400]
],
"sLengthMenu": "MENU",
and
"lengthMenu": 'Display <select>'+
'<option value="10">10</option>'+
'<option value="20">20</option>'+
'<option value="30">30</option>'+
'<option value="40">40</option>'+
'<option value="50">50</option>'+
'<option value="-1">All</option>'+
'</select> records'
The first worked button-wise, but the caption didn't changed (showed "Show 10 rows").
The second just didn't worked.
Thanks,
Yishay
This question has an accepted answers - jump to answer
Answers
Use the
text
option of thepageLength
button type.Allan
Hi Allan,
I'm sorry, I forgot to mention this in my previous post, we already done that:
Thanks,
Yishay
Does that resolve to be an empty string? If so, that might be the issue.
Allan
Hi Allan,
that seems to be the issue.
It still seems that both ways defined in the documentation doesn't work (these are the only way to show on the button the number of records selected).
Thanks,
Yishay
It looks like there is a bug that the button text is overridden when the value is changed. It work for me on first load, but not after a change. That is a bug that will need to be addressed.
Allan
Using the
language.buttons.pageLength
option works:Example: http://live.datatables.net/siqegube/1/edit .
Allan
Works like a charm.
Thanks!
Yishay