Datatable in built filter/searching is not working.
Datatable in built filter/searching is not working.
Hello,
Good Morning!
Default filter option is not working.When I search particualr word from a column, it does not bring up matching records, instead it shows the error messages that I have in language attribute.
Also can I know if length menu can accepts 5 records as minimum instead of 10?
Here is the script that I am using:
$(document).ready(function(){
$('#example').dataTable( {
"bStateSave": false,
"language": { "zeroRecords": "Nothing found - sorry",
"info": "Showing page PAGE of PAGES",
"infoEmpty": "No records available",
"infoFiltered": "(filtered from MAX total records)"
},
"bFilter": true,
"jQueryUI": true,
"lengthMenu":[10,20,30],
"aoColumnDefs": [{ "bSortable": false, "aTargets": [ 0 ] },{ "bSortable": false, "aTargets": [ 1 ] },
{ "bSortable": false, "aTargets": [ 2 ] },{ "bSortable": false, "aTargets": [ 3 ] },
{ "bSortable": false, "aTargets": [ 4 ] },{ "bSortable": false, "aTargets": [ 5 ] },
{ "bSortable": false, "aTargets": [ 6 ] },{ "bSortable": false, "aTargets": [ 7 ] },
{ "bSortable": false, "aTargets": [ 8 ] },{ "bSortable": false, "aTargets": [ 9 ] },
{ "bSortable": false, "aTargets": [ 10 ]},{ "bSortable": false, "aTargets": [ 11 ]}]
} );
});
Can anyone please help me out.
Answers
You can set lengthMenu parameters to suit yourself.
https://datatables.net/reference/option/lengthMenu
Sorry I tried this in my script, it did not work. I am not sure whether length menu is working in my page or not:
"lengthMenu":[4,8,16]
Someone pls help me. Filter and Length menu doesn't work for me.
Please provide a link to a page showing the problem, as required in the forum rules.
http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest