Filter multiple data in same column
Filter multiple data in same column
VENGAT
Posts: 15Questions: 3Answers: 0
Can multiple data be filtered from single column.
For Example the column contains (New York, London, Tokyo, etc..)
I want to filter both London and Tokyo.
How to filter both London and Tokyo.
Thanks in Advance
This question has accepted answers - jump to:
This discussion has been closed.
Answers
you can use my yadcf plugin for datatables , it has a multi select filter (and 8 other types) http://yadcf-showcase.appspot.com/DOM_source_chosen.html , the multi select can be integrated with chosen or select2 plugin (for better UI/UX) , go over the showcase/examples/ docs in the yadcf js file ...
I want to get two different value from same column but your plugin not match my condition
see first column on the left , select the "Some Data 1" and then select the "Some Data 3" and see how the table shows you only rows that have one of those values in their first column
Should i be downloading the jquery plugin and use it?
daniel thanks a lot for your help......
you need yadcf js and css and in case that you want to use the chosen/select2 you need to get their js/css images etc... make sure to read docs inspect showcase and their code example
Yes, I got a answer.
I have another doubt, using jquery how to trigger the select option. if you have any idea.
Thanks in Advance
If you want to trigger yadcf filters pragmatically, you should use the yadcf.exFilterColumn see its usage on first table http://yadcf-showcase.appspot.com/multiple_tables.html
daniel thanks a lot for your help......
Use the yadcf.exFilterColumn function,
suppose your table stored in myTable varible and you want to trigger the select filter for the first column using the checkbox value
can i use multiselect option with different column.
you mean one multiselect filter that will control multiple columns? that not possible ,but there is a similar issue already open , https://github.com/vedmack/yadcf/issues/79 you can add the type of filter that you want to be added to that feature... but you should know that a filter that control multiple columns will be located outside the table (in some container)
Hi...
How to Filter Male, Female option in you Plugin.
Give me the code.
Thanks in Advance....
Hi daniel
I got a Answer from your Plugin ,
Hi,
how to hide particular column, with perform your plugin.
can't work this following function:
$(document).ready(function() {
var oTable = $('#example').dataTable();
oTable.fnSetColumnVis( 1, false );
} );
Hiding a column is not related to yadcf, but if you do hide a column you can show its filter outside the table using a filter_container_id property, look at the http://yadcf-showcase.appspot.com/DOM_source.html example "External filter for Dates column" above the table in the left corner
Any other option to hide entire row
basically row will be hidden if it does not match the filter criteria... i.e if you filter for "orange" in some column and a certain row (column) does not have orange value ---> the entire row will be hidden
Hello
I shared another solution. I'm not sure old version can do it. latest version support regex in search function.
var val = [];
val.push("ASIA");
val.push("Africa");
val.push("EU");
val.push("USA");
var table = $("#example").Datatable();
var mergedVal = val.join('|');
table.column(1).search(mergedVal,true).draw();