Appendind element to table header th triggers sort each time I click on it?

Appendind element to table header th triggers sort each time I click on it?

daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
edited December 2012 in DataTables 1.9
Hi
I'm adding element
in the following way
[code]
"fnDrawCallback": function( oSettings ) {
appendSelectFilter(oSettings);
},

.
.
.

function appendSelectFilter(oSettings){
if($("#bookmarks_table thead th:eq(3)").find("select").length === 0){
$("#bookmarks_table thead th:eq(3)").append("VolvoSaab");
}
}
[/code]

The problem that each time I click on the select element (without even choosing value) the table being sorted...

How can I prevent the soring ?

Can I use evet.preventDefault or something ?

Thanks ahead

Daniel.

Replies

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    OK,

    That was quick :)

    added `onclick='event.stopPropagation();'` to select element...

    Is there any other way to achieve this ? (disable sorting when clicking on select or any other html element appended to the th?)
This discussion has been closed.