Moving the Length Selector into a table construct
Moving the Length Selector into a table construct
Doltsche
Posts: 9Questions: 0Answers: 0
Dear community,
What I'd like to do is to create a plain HTML table inside the top of the datatables in order to align further elements (e.g. advanced filter options) in the datatables top.
To get you an idea of what I want to achieve I've uploaded a screenshot of the current state:
http://imageshack.us/photo/my-images/254/advancefilter.png
The textboxes, labels and the search button, all are inside a table. My question now is, how to I achieve that I get the Length element (Show ... entriue) also into a column of the table i've injected into the datatables top?
The code actually looks like this:
[code]
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sDom": '<"H"l<"searchBarDiv">>t<"F"ip>',
[...]
});
// contains the table structure
var sSearchBarContent = $('#SearchPersonFAInfoSearchDiv').html();
$('div.searchBarDiv').html(sSearchBarContent);
$('#SearchPersonFAInfoSearchDiv').remove();
[/code]
During some search I found a ways which allows to completly rewrite the Length Element: https://datatables.net/forums/discussion/13788/request-custom-length-control-plugin-using-instead-of-/p1
But actually I do not want to customize it, but to position e.g. to wrap it by a table.
Hope for further help.
Best regards
Samuel
What I'd like to do is to create a plain HTML table inside the top of the datatables in order to align further elements (e.g. advanced filter options) in the datatables top.
To get you an idea of what I want to achieve I've uploaded a screenshot of the current state:
http://imageshack.us/photo/my-images/254/advancefilter.png
The textboxes, labels and the search button, all are inside a table. My question now is, how to I achieve that I get the Length element (Show ... entriue) also into a column of the table i've injected into the datatables top?
The code actually looks like this:
[code]
oTable = $('#example').dataTable({
"bJQueryUI": true,
"sDom": '<"H"l<"searchBarDiv">>t<"F"ip>',
[...]
});
// contains the table structure
var sSearchBarContent = $('#SearchPersonFAInfoSearchDiv').html();
$('div.searchBarDiv').html(sSearchBarContent);
$('#SearchPersonFAInfoSearchDiv').remove();
[/code]
During some search I found a ways which allows to completly rewrite the Length Element: https://datatables.net/forums/discussion/13788/request-custom-length-control-plugin-using-instead-of-/p1
But actually I do not want to customize it, but to position e.g. to wrap it by a table.
Hope for further help.
Best regards
Samuel
This discussion has been closed.
Replies
Allan
Thank you for your response. During the weekend, I had that much to do that I forgot to answer.
When I append the html code, the controls generated by datatables will be outside of my added content e.g. the table. I'd like to put the controls, which are generated by the datatables also into the table, which I add to the tables header.
Hope this helps you understand what I mean =)
Best regards
Samuel
Allan
Thank you for taking time considering my problem.
Best regards
Samuel