Location of fnAdjustColumnSizing call

Location of fnAdjustColumnSizing call

boatrokrboatrokr Posts: 6Questions: 0Answers: 0
edited October 2013 in General
Hi All(an),

I'm using ColReorderWithResize.js and ScrollY.

I'm trying to determine where to place it so the columns are lined up on page load.

The function call works when I call it from:
- Window resize
- a button

The function call doesn't work when I call it from:
- fnInitComplete
- fnDrawCallback (I send a fnAdjustColumnSizing(false) otherwise we get a infinite loop)
- the tab container .show() method (my table is in a bootstrap 2.3.2 tab)

I'm still plugging away but figured someone might have already dealt with this.

Thanks!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    fnInitComplete should be the place to do it:

    [code]
    fnInitComplete: function () {
    this.fnAdjustColumnSizing();
    }
    [/code]

    Are you able to link me to the page you are working on so I can take a look and see what is going wrong?

    Thanks,
    Allan
  • boatrokrboatrokr Posts: 6Questions: 0Answers: 0
    Here's the debugger info http://debug.datatables.net/ubovof
  • boatrokrboatrokr Posts: 6Questions: 0Answers: 0
    It looks to me like the issue is related to it sitting in a tab that loads as active.

    The tab.show() and shown() are only called when the tab is clicked, and not when the tab is selected as the active tab for page load.

    I've added bRetrieve and have moved my table initialization to document.ready to try and remedy this - to no avail.
  • boatrokrboatrokr Posts: 6Questions: 0Answers: 0
    New debugger: oteqag
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Unfortunately, because it appears to be a tab related issue, the DataTables debugger trace doesn't actually help a huge amount as it only provides information about DataTables.

    What tab implementation are you using? If jQuery UI 1.10, you might try the following:

    [code]
    $("#tabs").tabs( {
    "activate": function(event, ui) {
    $.each( $.fn.dataTable.fnTables( true ), function () {
    $(this).dataTable().fnAdjustColumnSizing();
    } );
    }
    } );
    [/code]

    Regards,
    Allan
This discussion has been closed.