Multiple selection in column filtering

Multiple selection in column filtering

SimonSebrightSimonSebright Posts: 2Questions: 1Answers: 0

Hi, I am looking to replace the column filtering dropdowns with multiple selection elements (checkboxes, Select element with multiple selections allowed) to allow our user to select multiple values with OR logic (e.g. show me all projects with status green or red). Is this possible with the DataTables library? Thanks in advance, Simon

Answers

  • theWizardtheWizard Posts: 5Questions: 1Answers: 0

    Hi Simon, this is indeed possible. For each column you can set an indiviual search filter as you can see in the following example:

    https://datatables.net/examples/api/multi_filter.html

    The filter value itself uses the OR logic already. Every value separated by a space is seen as a separate value. So in your solution you just need to set the column search value depending on the selection.

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67

    you can try my yadcf plugin for datatables, it suppport select2 / chosen / any otherselect plugin and it support multi select as well, see showcase page (notice forst column filter) http://yadcf-showcase.appspot.com/DOM_source_select2.html

  • SimonSebrightSimonSebright Posts: 2Questions: 1Answers: 0

    Hi theWizard, thanks, but I am not sure that I expressed myself correctly. The example you quote does not appear to have OR logic. For example, if I type "cara ashton" into the name search box, I get nothing. In my example, we have dropdowns for the available values in columns and want to multi-select these. For example, imagine a list of projects. Each has a status, which might be green, red or yellow. I want to have the UI allow me to select all projects with either green or yellow, for example. Thanks and regards, Simon

This discussion has been closed.