Datatable Sharepoint list filter data by clicking on icons/badges
Datatable Sharepoint list filter data by clicking on icons/badges
Hello,
I have this code:
https://live.datatables.net/bitoteji/1/edit
Result:
The problem is I don't know how to achieve filtering this table by clicking on an icon. For example, I want to click on "Workplace" icon and that table would show only items with project type (field name Project_x0020_Summary) "Workplace Services" and so on. Also I want click on "Late" badge and get table filtered by status "Late".
There is "data-filter" attribute to use for filtering table data, for example "<td data-filter="Tiger Nixon">T. Nixon</td>", but how to use it with Sharepoint list and how to achieve filtering by clicking on icon/badge?
Thanks in advance!!
This question has an accepted answers - jump to answer
Answers
Your test case has some errors and doesn't run. Create a click event handler for the buttons and in the event handler use
column().search()
to search for the appropriate data. I built a simple example to show one way of doing this:https://live.datatables.net/petepehu/1/edit
Kevin