Skip to content
Discussion options

You must be logged in to vote

I've actually followed #2047 @vsSanti way, and implemented multiselect.

  1. Added filterType:
    () => ({
[...]
      multiSelect: (rows, id, filterValues) => {
        if (filterValues.length === 0) return rows;
        return rows.filter((r) => filterValues.includes(r.values[id]));
      },
[...]
    }),
    []
  );
  1. In columns object added the filters:
  const columns = React.useMemo(
    () => [
[...]
      {
        Header: "Make",
        accessor: "make",
        Filter: MultiCheckBoxColumnFilter,
        filter: "multiSelect",
      },
[...] 
  1. And then the actual component. Not the most efficient one, but works for my case. It also allows switching from selecting all, or one, or …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@dmathijs
Comment options

@jelizarovas
Comment options

@jelizarovas
Comment options

@jelizarovas
Comment options

@melvinalmonte
Comment options

Answer selected by jelizarovas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants