Order handle
Order handle
anthonys
Posts: 19Questions: 4Answers: 0
Hi, I'm trying to see if there is an easy way to assign a handle for ordering columns. I've found the orderCellsTop option, but I can't find a way to specify the trigger element. I'd like the handle to be the little ordering arrows as users keep accidentally clicking on the quite large table cell headers we are using.
This discussion has been closed.
Answers
Hi,
The
order.listener()
method can be used to attach the DataTables ordering listener to any element. So what needs to be done is to remove the existing click event and then attach it to whatever icon you have in the header.I've put a little example together. In that case I've used an SVG sorting icon, which is added via jQuery to the header, but you could use any icon you want.
Regards,
Allan