Order handle

Order handle

anthonysanthonys 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.

Answers

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    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

This discussion has been closed.