Is it possible to add a dropdown filter box at the top of the data table?
Is it possible to add a dropdown filter box at the top of the data table?
Hi,
Loving this plugin and using it for the first time...
I have a data table that's working great with this plugin. So far so good.
However, I've been asked to add a filter dropdown box above the table. It should be a dropdown containing the unique elements of one column, in this case, 'Role.' For instance if there are 100 rows on the table which look like this:
Role Name
Manager Joe
Employee Stan
Manager Sheri
Above this table should be a dropdown that when the user clicked it, would just show "Manager" and "Employee", and then the user could select one and the table would show just the rows for that particular role. So if they selected Manager, only the rows with Joe and Sheri would appear in the data table.
Is this possible?
Thanks for any help...
Answers
I'm not sure I understand completely what you want, but take a look at what I implemented here:
https://kniel.de/power-supplies-primary-switchers
I think this might include a solution for your needs. The Output and Measurement columns filter on data found in the same column, the Mounting column is filtered on the content of the combination of 7 invisible columns.
HTH, Hans
That's close to what I'm looking for.
In your example, the dropdowns are the actual headings of the columns. What I'm looking to do is keep my table headings as they are, e.g. "Role", "Name" with the default arrows next to them that allow you to sort ascending or descending. Then above the table headings have a separate dropdown box just for the Role so it would look like:
"Role <dropdown filter selector box>"
(then the table itself)
Role Name
Manager Joe
.
.