How can I stop header from sorting when custom dropdown is clicked?
How can I stop header from sorting when custom dropdown is clicked?
m_powell
Posts: 2Questions: 1Answers: 0
I've put a custom dropdown in the headers of some of my datatables using Bootstrap Multiselect. I've also made the tables sortable. This is what it looks like:
The problem I'm having is that when I click the dropdown, the table also sorts. I only want the table to sort when I click the header, but not the dropdown button. The only place I've found a similar issue is here. However, this will not work, because it causes the dropdown not to appear.
This discussion has been closed.
Answers
Typically two header rows would be used for this. The top will contain the header titles along with the sort functions. The second will contain the search inputs. Here is an example with drop down:
http://live.datatables.net/kagadudu/1/edit
You will need to use
orderCellsTop
to accomplish this.Kevin
Is it possible to use one? We liked the way the design looked with only one cell.