What to put in sDom to display lengthmenu with bootstrap

What to put in sDom to display lengthmenu with bootstrap

madawebmadaweb Posts: 17Questions: 0Answers: 0
edited January 2013 in TableTools
Hi!

Before using Tabletools in my datatable, I have on top of my table: listbox of lines number
[code]"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]][/code]
but when I use tabletools like this: http://datatables.net/release-datatables/extras/TableTools/bootstrap.html
it disappears, it remains tabletools buttons and search box

I find that it is caused by the "sDom" value, I don't understand how to configure it!

I want to display the 3 elements: tabletools menu - number lines listbox - search box!

Replies

  • madawebmadaweb Posts: 17Questions: 0Answers: 0
    sDom to show the tabletools toolbar:
    [code]"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>"[/code]
    But how to display length menu too?
    I tried:
    [code]"sDom": "<'row-fluid'<'span6'T><'span6'f>r>t<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6 center'p>>",[/code]
    The result is ridiculous!
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Yup - sDom sucks. Plan is to revamp it in 1.11 when that happens... Until then, what you've done looks fine.

    Allan
  • madawebmadaweb Posts: 17Questions: 0Answers: 0
    What I've done is not OK! It displays:
    TableTool toolbar - search box
    Number listbox - search box

    So, "search box" repeated and presentation is 2 lines instead of just one line.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    In which case, just don't include the `f` option twice :-)
  • madawebmadaweb Posts: 17Questions: 0Answers: 0
    ok, I think now it's ok:
    [code]"sDom": "<'row-fluid'<'span4'T><'span4'l><'span4'f>r>t<'row-fluid'<'span6'i><'span6 center'p>>"[/code]
This discussion has been closed.