Search and filter rows based on click of an element in the DataTables
Search and filter rows based on click of an element in the DataTables
Sushmitha_
Posts: 1Questions: 0Answers: 0
Initial Table:
Expected Result:
When I click on ‘Success’ in row ‘A’ and Column ‘Commit’, I want the entire row ‘A’ to be displayed as shown below:
If there are similar rows, it must be displayed as shown below:
My code:
On click of Success:
column.search(this.value).draw();
My Output:
How do I retrieve the expected result? Is there any inbuilt function in datatables?
Thank you in advance.
Replies
This delegated events example should get you started. You will need to add
td
to the selector to limit the event to the Commit column. You can usecell().data()
to get the value in the clicked cell.Kevin
Here is a simple example:
https://live.datatables.net/tefugala/1/edit
It uses
columns.className
to assign a classname that is used as part of the event handler selector.Kevin