SELECT filter on top
SELECT filter on top
nskwortsow
Posts: 120Questions: 0Answers: 0
Hi,
How would I place the SELECT filters on *top* of the table, rather than below, as seen in the example:
http://datatables.net/release-datatables/examples/api/multi_filter_select.html
Thanks,
Nathan
How would I place the SELECT filters on *top* of the table, rather than below, as seen in the example:
http://datatables.net/release-datatables/examples/api/multi_filter_select.html
Thanks,
Nathan
This discussion has been closed.
Replies
[code]
/* Add a select menu for each TH element in the table footer */
$("tfoot th").each( function ( i ) {
this.innerHTML = fnCreateSelect( oTable.fnGetColumnData(i) );
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} );
[/code]
That's how it is being inserted into the footer. So you'd just need to add another row to the thead and modify the selector to insert into the new header row.
Allan
If I have HTML content in my TD, how do I prevent the SELECT OPTION from being populated with this HTML content? I.e. the only content should be the text inside the HTML (text inside a hyperlink)
[code]
r += ''+aData[i]+'';
[/code]
with:
[code]
var d = aData[i].replace( /<.*?>/g, "" );
r += ''+d+'';
[/code]
Allan