DataTables / Responsive

Responsive extension for DataTables, providing support for complex tables on all device screen sizes
Other
148 stars 86 forks source link

columns.adjust() API call should trigger Responsive._resize() #64

Closed djuba closed 8 years ago

djuba commented 8 years ago

http://jsfiddle.net/uonhekd8/5/

Bootstrap 3.3.5, DataTables 1.10.10, FixedHeader 3.1.0, Responsive 2.0.0

When you run the above jsFiddle, if you collapse the panel, resize the window, and then un-collapse the panel all columns except for the control are collapsed. Your columns.adjust() description says to make this api call after showing a hidden datatable which I have in the .on('shown') event handler in the jsFiddle, but it does not work completely for responsive tables because it does not trigger Responsive._resize(). Changing the .on('shown') event handler in the jsFiddle to $(window).trigger('resize') has the desired result but i do not think this is the best solution. I believe the following code should be added to Responsive._constructor():

dt.on( 'column-sizing.dtr', function () {
    that._resize();
});
DataTables commented 8 years ago

Commit d8c2270f56f1b0979770b9fad7cb8e9569f16a63 also addresses this issue. Thanks for flagging it up!