External Dropdown filter based on column.
External Dropdown filter based on column.
ashiquem01
Posts: 24Questions: 5Answers: 0
Hi Teams,
https://live.datatables.net/xoqaqiyu/1/edit
In above Example I have created a drop down for filtering based on office Column
but filter is happening on all tables.
How can I achieve filter based on column?
Example:
Employee Name : Ashton Cox has position name is London and Office is San Francisco,
but when I select Office London in Drop down Employee Ashton Cox data also coming .
This question has accepted answers - jump to:
Answers
please refer this example
https://live.datatables.net/xoqaqiyu/3/edit
I'm seeing the result I would expect from your HTML.
@tangerine
refer https://live.datatables.net/xoqaqiyu/3/edit
<tr>
<td>Ashton Cox</td>
<td>London</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$4,800</td>
</tr>
here Position is London
but my dropdown filter is only for Office
No - it is a global filter (you've used
search()
. If you want to search a specific column, usecolumn().search()
:Updated example.
Allan
thanks @allan .
Worked
@allan
Instead of calling colum like table.column(2), can we call table.column('Column Name ')?
The
column-selector
docs provide all the options for referencing the column.Kevin