Automatic Column Resizing

Automatic Column Resizing

HammerTimeHammerTime Posts: 1Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
I'm using version 1.9.4 and have a jQuery datatable inside another plain HTML table. Inside my jQuery table are and elements. The options within the elements dynamically change based on other selections made by the user on the page. When the page first loads, the column sizes are calculated correctly within the table. However, when a user changes the value that alters the list within one of the columns, the datatable does not seem to recalculate and adjust the column widths to account for the increased/decreased size of the new .

For example, assume a datatable with 4 columns. Columns 3 and 4 are elements that say "Select..." when the page is first loaded. Once a user changes field A (not in the datatable), that loads the in column 3 only (options are dependent of field A's value). When these tags are loaded, they have description values that go beyond the original width of "Select..." and thus, the box expands as it should, but since it's larger now, half of the goes behind the content in column 4. I've tried calling fnAdjustColumnSizing() and/or fnDraw() after the tags are populated, but that does not seem to help. I've also tried enabling/disabling bAutoWidth, but with no luck either. Anything I'm missing here? Is it even possible to have the datatable recalculate the column widths after the underlying HTML changes?

Here are my configs:

[code]
$("#transactionEntryDetailTable").dataTable({
"bFilter": false,
"bPaginate": false,
"bInfo": false,
"bJQueryUI": true,
"bSort": false,
"oLanguage": {
"sEmptyTable": "No records found."
}
});
[/code]

Initial Page Load - http://www.flickr.com/photos/93663910@N07/8516656949/in/photostream
Select Behind Column - http://www.flickr.com/photos/93663910@N07/8517771396/in/photostream
This discussion has been closed.