Filter multiple data in same column

Filter multiple data in same column

VENGATVENGAT Posts: 15Questions: 3Answers: 0
edited September 2014 in Free community support

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:

Answers

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    Answer ✓

    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 ...

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0

    I want to get two different value from same column but your plugin not match my condition

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    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

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0

    Should i be downloading the jquery plugin and use it?

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0
    edited September 2014

    daniel thanks a lot for your help......

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    Answer ✓

    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

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0

    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

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    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

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0
    edited September 2014

    daniel thanks a lot for your help......

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    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

     yadcf.exFilterColumn(myTable, [
            [0, myCheckboxValue]
        ]);
    
  • VENGATVENGAT Posts: 15Questions: 3Answers: 0
    edited September 2014

    can i use multiselect option with different column.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    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)

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0

    Hi...
    How to Filter Male, Female option in you Plugin.
    Give me the code.

    Thanks in Advance....

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0

    Hi daniel

    I got a Answer from your Plugin ,

         Thanks
    
  • VENGATVENGAT Posts: 15Questions: 3Answers: 0
    edited September 2014

    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 );
    } );

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    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

  • VENGATVENGAT Posts: 15Questions: 3Answers: 0

    Any other option to hide entire row

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    Answer ✓

    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

  • nobunobu Posts: 5Questions: 2Answers: 0

    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();

This discussion has been closed.