Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82133

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

$
0
0
Hi
I'm adding <select> element
in the following way
        "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("<select><option value='volvo'>Volvo</option><option value='saab'>Saab</option></select>");
	}
}

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.

Viewing all articles
Browse latest Browse all 82133

Trending Articles