Maanstraat
Maanstraat

Reputation: 1251

DataTables place search and entries filter under the table?

Can I place the Show entires filter in the search filter under the table instead of above the table?

See: http://datatables.net/release-datatables/examples/basic_init/alt_pagination.html

And I know I can place een position : absolute and stuff but I want the HTML code of those things under the table.

Upvotes: 3

Views: 8601

Answers (2)

vipinlalrv
vipinlalrv

Reputation: 3065

Place your Div anywhere you want

$('div.dataTables_filter').appendTo("#filterdata");

<div id="filterdata">

</div>

Upvotes: 1

Maanstraat
Maanstraat

Reputation: 1251

Found the solution:

"sDom": 't<plf>'

This initialisation variable allows you to specify exactly where in the DOM you want DataTables to inject the various controls it adds to the page (for example you might want the pagination controls at the top of the table). DIV elements (with or without a custom class) can also be added to aid styling. The follow syntax is used:
The following options are allowed:

'l' - Length changing
'f' - Filtering input
't' - The table!
'i' - Information
'p' - Pagination
'r' - pRocessing
The following constants are allowed:
'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
The following syntax is expected:
'<' and '>' - div elements
'<"class" and '>' - div with a class
'<"#id" and '>' - div with an ID
Examples:
'<"wrapper"flipt>', '<lf<t>ip>'

Upvotes: 7

Related Questions