DataTables logo DataTables

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormarlar
    • CommentTimeMar 9th 2009
     
    Hi Allan,

    I don't fully understand the sDom syntax. Take your example:

    "sDom": '<"top"i>rt<"bottom"flp><"clear">'

    How do I read this?

    I understand the letters as identifying parts of the table elements, but

    < and > - div elements
    <"class" and > - div with a class

    is really not clear to me!

    Thanks,
    Martin
    • CommentAuthorallan
    • CommentTimeMar 9th 2009 edited
     
    Hi Martin,

    The sDom syntax is a little bit obscure at first glance. I've done it this way in order to keep it concise. Possibly the best way of thinking of it is that

    '<' gives '<div>'
    '<"class"' gives '<div class="class">'
    '>' gives '</div>'

    So the example above is really:

    <div class="top">
        i
    </div>
    rt
    <div class="bottom">
        flp
    </div>
    <div class="clear"></div>
    


    Does this help to understand it better?

    Allan
    • CommentAuthormarlar
    • CommentTimeMar 9th 2009
     
    Hi,

    Thanks, that helped!

    I initially thought that the divs referred to existing divs, but now I understand that the datatable actually injects these divs are the given position.

    Martin
    • CommentAuthoratlas3650
    • CommentTimeJul 1st 2009 edited
     
    Hi,

    It looks like you can render the pager twice, but not the info. I need to render both twice. Thus:


    "sDom": '<"pager"p>t<"pager"p><"info"i><"clear">',


    works but


    "sDom": '<"info"i><"pager"p>t<"info"i><"pager"p><"clear">',


    does not render the info section twice.

    Neither does something simpler:


    "sDom": '<"pager"ip>t<"pager"ip><"clear">',


    Any ideas why?

    Thanks,
    • CommentAuthoratlas3650
    • CommentTimeJul 1st 2009 edited
     
    Also, the full_numbers pager does not render the page numbers on the top (but it does render the first/previous/next/last controls on the top) when you request rendering it both on the top and the bottom.
    • CommentAuthorallan
    • CommentTimeJul 1st 2009
     
    Hi atlas3650,

    Rendering elements twice (pager, info etc) is not supported in the built-in DataTables DOM handling. If you want to do this you need to either use the API, or modify the source code. The API will certainly help with the paging, but there isn't really a method to deal with the info element directly. What you could do is use the fnDrawCallback() function and update other elements on the page as you see fit.

    Regards,
    Allan
    • CommentAuthormathie
    • CommentTimeSep 17th 2009
     
    I just want to modify the default layout a little bit (move the length dropbox to the bottom). Can someone post the positioning string for the default layout?
    • CommentAuthorallan
    • CommentTimeSep 18th 2009
     
    Hi mathie,

    The default is given in the documentation: http://datatables.net/usage/options#sDom (click on the "Show Details" link).

    Regards,
    Allan