Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change DataTable Search Label

Been trying to change the Search: to Filter: in my datatable that I created.

I tried this that i found:

$(document).ready(function() { oTable = $('#datatable-example_filter').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: "   } }); } );  

but it is not working, #datatable-example_filter is the name of the id, inside the div that is generated by dataTable

like image 611
efecarranza Avatar asked Apr 28 '15 20:04

efecarranza


Video Answer


1 Answers

The other answer that uses "oLanguage" is using legacy DataTables api. According to DataTables v 1.10+ documentation, the syntax is:

$('#example').dataTable( {   "language": {     "search": "Filter records:"   } } ); 
like image 67
devlin carnate Avatar answered Oct 11 '22 07:10

devlin carnate