Column size cannot be calculated - on second request everything fine

Column size cannot be calculated - on second request everything fine

ecomentecoment Posts: 1Questions: 0Answers: 0
edited June 2012 in DataTables 1.9
Hi there,

datatables are awesome! But I have problems adjusting the size of columns in Chrome and Safari. In Firefox, IE and Opera everything works fine.

I open a new jQuery UI Dialog and inside this dialog I create a datatable with an ajax source. So far everything works fine, except columns with very long names without spaces, e.g. "sdkfsd3343jlfksfj24423jlkdsjfskdf" (there are three columns: name, type and change date).

If such an entry is in a row, dataTables cannot adjust the column size. But when I hit the reload button which generally destroys the datatable and loads the whole datatable again, everything works fine.

Here is my code which initializes the datatable:

[code]
var dataTable = $('#contentListing').dataTable({
sAjaxSource: ajaxSource,
bPaginate: false,
sScrollY: '290px',
bAutoWidth: false,
bInfo: false,
bSearch: false,
bFilter: false,
bDestroy: true,
bProcessing: false,
fnInitComplete: function(oSettings, json) {
$('#contentListing tbody tr#' + selectId + ' td:first').trigger('click');
$('#contentListing').addClass('noclear');
ContentChooser.currentLoadedContent = id;
},
'aoColumnDefs': [
{'sWidth': '50%', 'aTargets': [0]},
{'sWidth': '15%', 'aTargets': [1]},
{'sWidth': '35%', 'aTargets': [2]}
]
});
[/code]

So at the first initialization of the datable with very long data in columns without spaces the columns can not be calculated, showing an "DataTable Warning" in the console. If I load the same table again by the same code in the openend jquery UI dialog everything works fine.

Is this a bug in datatables, webkit or am I missing a point?

Thanks,
Martin
This discussion has been closed.