Moving the Length Selector into a table construct

Moving the Length Selector into a table construct

DoltscheDoltsche Posts: 9Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
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

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm not quite clear what you are looking for i'm afraid. If you want to put an HTML table into the header for filtering controls, can you not just do that with a simple append() or html()?

    Allan
  • DoltscheDoltsche Posts: 9Questions: 0Answers: 0
    Hello 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
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    In which case, can you not use the method you describe above? it looks like you have what is needed already!

    Allan
  • DoltscheDoltsche Posts: 9Questions: 0Answers: 0
    Hm, I will investiage the code further, which I linked in my starting question =).

    Thank you for taking time considering my problem.

    Best regards

    Samuel
This discussion has been closed.