Data tables filtering for multiple words
Data tables filtering for multiple words
Hi Allan,
I am using data tables for my project for the first time. It really having cool features with very minimal coding. I am coming across some probs.
Data tables filtering is not working properly, if I am filtering on columns if I am giving 2 words a sentence in the filtering it is looking for different words matching rather than the complete sentence. will it be possible to search only for the matching sentence.
Also how to ignore the filtering for particular column, I am having a img icon where it has URL for the link, if I just type a number , if number is there in the URL , its displaying back those results also.
Thanks
Syam
I am using data tables for my project for the first time. It really having cool features with very minimal coding. I am coming across some probs.
Data tables filtering is not working properly, if I am filtering on columns if I am giving 2 words a sentence in the filtering it is looking for different words matching rather than the complete sentence. will it be possible to search only for the matching sentence.
Also how to ignore the filtering for particular column, I am having a img icon where it has URL for the link, if I just type a number , if number is there in the URL , its displaying back those results also.
Thanks
Syam
This discussion has been closed.
Replies
2. You can set bFilter:false ( http://datatables.net/usage/columns#bFilter ) to remove a specific column from filtering.
Allan
for your prompt reply.
hope will get next version soon with custom filters.
Thanks
Syam
for some reason disabling the searchable for a column is not working if I disable the sorting for all columns.
my code is like this.
jQuery(document).ready(function() {
jQuery('#tempLib').dataTable({
"bPaginate": false,
"bLengthChange": false,
"aoColumns": [
{ "bSearchable": false },
null,
null,
null
],
"aaSorting": [[ 1, "asc" ]],
"aoColumns": [
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false }
],
"bInfo": false,
"bAutoWidth": false } );
});
My requirement is very simple I want all the data to be sorted by second column by default, and I dont want any sorting later, also I dont want first column to be searchable, as it has hyperlink and I am passing some Ids in the URL, it is searching those Ids also.
Can you please let me know what is wrong in the above code.
If I just remove this part
"aoColumns": [
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false }
],
It is not searching for the first column which is working fine, but I am getting sorting option for all the column names on top, which I dont need.
Please suggest.
Thanks
Syam
This should work:
"aoColumns": [
{ "bSearchable": false, "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false }
]
it worked.
Syam