Squished Datatable

Squished Datatable

dnirvinednirvine Posts: 7Questions: 0Answers: 0
edited January 2014 in General
I have a data-table at http://coc.dniwebdesign.com which shows up perfectly and works the way I need it too. However, when I click a members name (right now it's only on "dnirvine") it opens a lightbox with another datatable. The problem is the datatable in the iframe isn't full width but squished to one side. How would I be able to fix it? I am using Firefox and haven't tried to see if this re-occurs in any other browser. You should be able to see the problem at the page listed above. Thanks. :)

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > right now it's only on "dnirvine"

    Doesn't appear to be doing anything even on `dnirvine` I'm afraid. However, my guess is that the table is hidden when it is initialised. If this is the case, then you need to call fnAdjustColumnSizing when the table is made visible.

    Allan
  • dnirvinednirvine Posts: 7Questions: 0Answers: 0
    It doesn't seem to have fixed it or done anything really. My columns still appear to be squished yet the function is called and there are no errors.

    http://coc.dniwebdesign.com/help.png

    By "right now it's only on dnirvine" I mean that, that's the only one I have activated to see the profile of the user. I'm sure it would be the same on all users profile pages as it's the same page.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm sure it is on all as well - and I can see the problem occurring now. The lightbox is opening on `dnirvine` which is wasn't before.

    You need to use fnAdjustColumnSizing when the table is made visible. Something like:

    [code]
    $('#stats').dataTable().fnAdjustColumnSizing()
    [/code]

    in the iframe'd document would do.

    Allan
  • dnirvinednirvine Posts: 7Questions: 0Answers: 0
    Hate to say it man but nothing. I've added that to the end and it still is squished to the left. :(
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited January 2014
    It looks like it is executing before the frame is made visible. For example open this: http://coc.dniwebdesign.com/member.php?id=10

    It needs to be done once the table is visible - otherwise it doesn't have any height / width and the calculations are meaningless. How exactly you do that, i'm not sure - perhaps the fancy box as an API for letting you know or something.

    Allan
This discussion has been closed.