Icon beside Table head?

Icon beside Table head?

hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0

Hello,
Is it possible to place an icon beside a table head column?
Like the image Search.gif in column "Numbers"

Name Nr. Numbers  Filter Extra

I can do this, but if clicking on the icon "Search" the column will be sorted.
I think this is because it is inside the table head and all will be recognized as a normal table head.

Is it possible to avoid the sorting if clicking on the icon and just sort if click on the word "Numbers" or the normal sort icon?

hawk

This question has an accepted answers - jump to answer

Answers

  • hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0

    not possible to do that in a column header?

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    Add a click event handler to your icon and call stopPropagation() on the event object to stop the event bubbling up to the DataTables click handler.

    Allan

  • hawkmasterhawkmaster Posts: 56Questions: 20Answers: 0

    thanks Allen
    works like a charme.

    ...
    $('#FilterRating').click(function(e){
    e.stopPropagation();
    ...
    hawk

This discussion has been closed.