Change the word Search to Filter
Change the word Search to Filter
martinsebastian
Posts: 5Questions: 0Answers: 0
Hello
I cannot for the life of me figure out the correct syntax for changing the word SEARCH to the word FILTER which really is way more fitting.
Here is my code:
$(document).ready(function() {
oTable = $('#example').dataTable({
"aaSorting": [[ 10, "desc" ]],
"bJQueryUI": true,
"aLengthMenu": [[25, 50, 100, 250, 500, -1], [25, 50, 100, 250, 500, "All"]],
"sPaginationType": "full_numbers"
});
} );
Also how do I put the FOCUS on the search/filter text box???
Thanks
I cannot for the life of me figure out the correct syntax for changing the word SEARCH to the word FILTER which really is way more fitting.
Here is my code:
$(document).ready(function() {
oTable = $('#example').dataTable({
"aaSorting": [[ 10, "desc" ]],
"bJQueryUI": true,
"aLengthMenu": [[25, 50, 100, 250, 500, -1], [25, 50, 100, 250, 500, "All"]],
"sPaginationType": "full_numbers"
});
} );
Also how do I put the FOCUS on the search/filter text box???
Thanks
This discussion has been closed.
Replies
[code]
$(document).ready(function() {
oTable = $('#example').dataTable({
"aaSorting": [[ 10, "desc" ]],
"bJQueryUI": true,
"aLengthMenu": [[25, 50, 100, 250, 500, -1], [25, 50, 100, 250, 500, "All"]],
"sPaginationType": "full_numbers", // [Edit: forgot the comma here when first posted]
"oLanguage": {
"sSearch": "Filter: "
}
});
} ); [/code]
the dom element created for the filter is a div with id {tableid}_filter, i.e. "example_filter" if your table id is "example". In that div a is created, which has the value of sSearch. in that label is a
something like this should set focus:
[code]$('#example_filter label input:text').focus();[/code]
http://www.datatables.net/release-datatables/examples/advanced_init/language_file.html
here's an example of a language file:
http://www.datatables.net/examples/examples_support/de_DE.txt
"oLanguage": {
Here is my complete code:
$(document).ready(function() {
oTable = $('#example').dataTable({
"aaSorting": [[ 10, "desc" ]],
"bJQueryUI": true,
"aLengthMenu": [[25, 50, 100, 250, 500, -1], [25, 50, 100, 250, 500, "All"]],
"sPaginationType": "full_numbers"
"oLanguage": {
"sSearch": "Filter: "
}
});
} );
"sPaginationType": "full_numbers" // <------ missing comma
"oLanguage": {
[/code]
my bad for not catching that when I posted above.
$('#example_filter label input:text').focus();
[code]
$(document).ready(function() {
oTable = $('#example').dataTable({
"aaSorting": [[ 10, "desc" ]],
"bJQueryUI": true,
"aLengthMenu": [[25, 50, 100, 250, 500, -1], [25, 50, 100, 250, 500, "All"]],
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "Filter: "
}
});
$('#example_filter label input:text').focus();
} );
[/code]
[code]
FILTER:
[/code]
[code]$('#example_filter input:text').focus();[/code]