Okay
  Public Ticket #3148371
Filtering with multi-selection option on column with 2 values present or greater
Closed

Comments

  • Mark Sayegh started the conversation

    I am wondering, If you look at my table, you will see that I have 2 filters for 2 different columns. 
    Currently when I use the multi-selector option and pick multiple values, the filter returns values that are present in any of those rows.  My intent is that users should be able to filter using the multi-selector on when only a row contains those 2 values or more if I select more filter criteria. What is happening now, is that the filter returns the 2 values that appear in any of the rows where I am looking for a filter that only shows you rows where those 2 values I select are present.


  •  1,850
    Miloš replied

    Hi, Mark 

    Thanks for reaching out to us.

    I am sorry, but I am not sure at all that I have correctly understood your goal here.

    It seems that you wish to set up an "exact match" for the filter, so that it only loads the rows where the value is exactly as searched for in the filter,   and not to allow other "partial results",  where it might be additional values together in a cell.

    If that Is what you need, you can simply enable this , in Column settings/Filtering/Exact filtering :

    5368406752.png

    Let me know if that solved what you need;

    or maybe if i completely misunderstood, could you elaborate in more detail, with an example - perhaps with additional screenshots, or a short video?

    Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Mark Sayegh replied

    Hello, you can now look at my site, you can see the search results. What I am asking for is say we have a row that contains ESPN Sports, I list all the sports they cover such as soccer, rugby and many others.

    When I did a filter search and I select multiple selections for example soccer and basketball, in the search I also get a return of The ESPN row because it contains the work soccer,  however I want it to display only the cells that have both Soccer and basketball as a sport they cover which could be in the tenth row. 

    Is this possible ? Thanks 


  •  1,850
    Miloš replied

    Hi, Mark

    I think i understood now, thank you for this clarification.

    So, basically, if you search for "Soccer and Basketball",  in the multiselectbox,

    you want to get only the resulting cells that contain both soccer and basketball together in cells;

    but to exclude the cells where there is only Soccer or only Basketball?

    4857162534.png

    -


    You can try this custom workaround to change the filtering logic from "OR" to "AND" , 

    i believe that should help.

    - Since here you are using "server-side processing" for your tables ( Manual table),

     you can edit a piece of the code in this file path :

     "   wp-content/plugins/wpdatatables/source/class.wpdatatable.php   "

    Find this line

    $search .= " OR ";

    and overwrite it with this

    $search .= " AND ";

    Let me know if that works as a solution for you?smile.png

    -

    And just to note, this code would get overwritten during updates, so you would have to repeat this at every update of the plugin.

    Thank you


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Mark Sayegh replied

    Thank You very much, yes this is what I am looking for.  

  •  1,850
    Miloš replied

    Hi, Mark 

    Sorry for the delayed response.

    -

    You're welcome, i am happy to help.

    If i understand, you have edited the code, and it's working as it should? ( Just checking, it should be).smile.png

    If you wish to see a built-in option to select the way how the filtering behaves, you can make a suggestion for our developers,

    and they will do their best to create an option in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -

    For the time being, though,  you will have to repeat this process at every Update,  because this code will be overwritten with the default one.

    -

    Let me know if you have any additional questions on this. Thank you

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables