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_r
Posts: 460Questions: 4Answers: 67
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.
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.
This discussion has been closed.
Replies
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?)