table width being set when table is re-initialised although bAutoWidth is set to false

table width being set when table is re-initialised although bAutoWidth is set to false

argonym2argonym2 Posts: 4Questions: 0Answers: 0
edited June 2011 in Bug reports
I initalize my dataTable with bAutoWidth: false. Everything is fine, and DataTables does not set any css widths.
But when I re-initialize the table (using bDestroy: true, and bAutoWidth still set to false), a fixed css width is added to the table style (column width are still not set).
I think in fnDestroy() there should be a check if bAutoWidth is true, before following line (roughly 2222) is executed:
[code]oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);[/code]

So something like:
[code]
/* Restore the width of the original table */
if ( oSettings.bAutoWidth === true )
{
oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);
}
[/code]
At least this works for me...

Thanks for the great work! DataTables saved me a lot of work.

Replies

  • argonym2argonym2 Posts: 4Questions: 0Answers: 0
    Nobody?
  • argonym2argonym2 Posts: 4Questions: 0Answers: 0
    Allan, wouldn't you consider this a bug?
  • argonym2argonym2 Posts: 4Questions: 0Answers: 0
    Pushing it to the top...
  • allanallan Posts: 61,805Questions: 1Answers: 10,119 Site admin
    Sorry I missed your posts before - yes this looks like it is a bug. I'll investigate more this evening and commit in your change then. Thanks for flagging this up (a couple of times :-) ).

    Regards,
    Allan
  • allanallan Posts: 61,805Questions: 1Answers: 10,119 Site admin
    There we go - first commit into DataTables 1.8.1.dev :-). Thanks for the patch - it will be available in the nightly soon.

    Regards,

    Allan
This discussion has been closed.