DataTables_info not displaying correctly after making a .each() initialization

DataTables_info not displaying correctly after making a .each() initialization

premiumbiscuitspremiumbiscuits Posts: 13Questions: 0Answers: 0
edited December 2012 in General
Here's a link to my code using the DataTables live example html: http://live.datatables.net/orevit

The example doesn't make quite as much sense without my html, but basically, I made a createDataTable function that I pass in the div IDs to. I'm creating 6 different datatables in my actual code, for use in a jqueryui accordion.

The problem that I'm having is that after using the function instead of initializing each table in a dedicated document.ready(), the "Showing 1 to x of x entries" footer is no longer a footer. It's showing up at the top of the page, and without appropriate styling. Additionally, after checking it out with firebird, it would seem that it's being rendered in the wrong place in the hierarchy, so the "fg-toolbar" class isn't inherited and subsequent styles are not being applied. Similarly, the search box isn't inheriting fg-toolbar either.

This is what it's supposed to look like: http://i.imgur.com/qcTfO.gif
And this is what it looks like after making the function for creating the datatables: http://i.imgur.com/gG29J.gif


Help would be appreciated! The only thing I changed between the two versions is the createDataTable function, so I'm not sure what could be causing it, especially since everything else seems to be working properly.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi,

    Thanks for posting up the live example :-)

    The problem is your sDom has HTML entities in it, which DataTables does not interpret - it simply looks at each character. So

    > "sDom": '<"H"Tfr>t<"F"ip>',

    Should be:

    [code]
    "sDom": '<"H"Tfr>t<"F"ip>',
    [/code]

    http://live.datatables.net/orevit/3/edit

    Allan
  • premiumbiscuitspremiumbiscuits Posts: 13Questions: 0Answers: 0
    Oh, derp. Thanks! I feel dumb now, haha. I originally had it embedded in an xslt file, but moved it to a separate javascript file and didn't realize that would change.

    Thanks a lot!!
This discussion has been closed.