width: 100px after running the bDestroy

width: 100px after running the bDestroy

KikketerKikketer Posts: 3Questions: 0Answers: 0
edited October 2012 in Bug reports
I'm playing with using two separate divs that alternate back and forth in visibility (one covering the other). Each of these divs have a datatable in them. The table itself is being used for radically different uses each time (the two divs alternate to smooth page flipping animations).

I placed the bDestroy flag to true whenever I render the div. But I did notice in Chrome the browser detect seems to be failing but only after bDestroy. I can see the outcome from the style attribute on the table getting a "width: 100px".

Looking at the code, line 4921 of the uncompressed has some sort of browser detection because of some IE issues with 100%. Although it appears the oSettings.oBrowser.bScrollOversize is coming through as true before and after the bDestroy.

Is anyone else seeing this situation? Is there a better and absolute way of destroying the table?

Replies

  • KikketerKikketer Posts: 3Questions: 0Answers: 0
    Of course seconds after posting this I find this bit of code in the source. I find that if I comment out this whole thing, things work just fine. Might be something to look into, but it works now for me.

    [code]
    /* Restore the width of the original table */
    if ( oSettings.oFeatures.bAutoWidth === true )
    {
    oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);
    }
    [/code]
  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    I've just tried it with Chrome in my basic example (http://datatables.net/release-datatables/examples/basic_init/zero_config.html ) and it seems to work as expected. Perhaps you can post a link to a page which shows the issue please?

    > Is anyone else seeing this situation? Is there a better and absolute way of destroying the table?

    Ideally you shouldn't really need to destroy the table at all :-). That should only be needed (at the moment) if you are adding and removing columns dynamically.

    Allan
  • KikketerKikketer Posts: 3Questions: 0Answers: 0
    I'll try and work up an example, very busy these last few days. It's part of a pretty large system, and I'll most likely find the true issue by reducing it down for an example. I'll post back here when I'm able to show what I'm seeing.

    Also, I am "dynamically" changing the columns. I have about 10 reports that I'm dynamically loading to either of the two divs. The reports are crazy different from each other, and I'm not even guaranteed which div which report will appear on (they simply alternate depending on which one the user clicked on).
This discussion has been closed.