Ways for users to select/filter multiple rows?

Ways for users to select/filter multiple rows?

theanoraktheanorak Posts: 1Questions: 1Answers: 0

I'm looking for some suggestions on how best to allow users to display a selection of rows from a dataset.

Specific questions:

  1. Search: is there a way to make the built-in search effectively use 'OR' for separate words? So with a table of fruits, typing 'apple pear banana' in the search box would leave three rows (one per fruit), rather than no results (because there isn't a row with 'apple pear banana' in it.

  2. Multiselect->filter: if I enable multiselect on a table, would searching for individual fruits then selecting them persist? I.e. will this work: search 'apple', select, search 'pear' select, search 'banana', select, click 'filter' button that filters the table to just the selected rows?

  3. is there a better alternative?

Answers

  • kthorngrenkthorngren Posts: 20,369Questions: 26Answers: 4,779
    1. You can use regex searching. Go to this example and in the Global Search select Treat as regex and uncheck Use smart search. In the Global search input type this tokyo|london to see all the rows with Tokyo or London. See the search() docs for details of the search modes.
    2. Here is an example using Select2 for multi-selection:
      https://live.datatables.net/jetupuda/86/edit

    Kevin

Sign In or Register to comment.