-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility issue in DataTable 2.0.0 #26
Comments
I have been able to make minor modifications for it to work with 2.0 |
First of all thanks for the modification. I've tried using it but it is only resizing the first two rows(this only happens when I don't reduce the number of columns). I need it to resize the complete column. I'm using Server-side processing(AJAX) for populating the data. The table has more than 40 columns. When I reduced the number of columns and tried to fit them into the screen it worked but as soon as we got the horizontal scroll bar(due to a large number of columns) then it stopped working. I'm using this(scrollX: true) and the table is looking is like this. Could you please help here @rahul-katikineni. |
Do we have any updates on this ? This is very helpful if it works with latest DataTable. Great feature by the way. Worth having it as part of the main github lib. |
I cannot create a MR based on @rahul-katikineni work because there are too much changes. However, after few changes changes I got the desired behavior. Merged file: jquery.dataTables.colResize.js Changes: _fnApplyWidthColumn: function (column, width) {
++ [$(column.nTh.table().context[0].colgroup).find('col')[column.idx], $(column.nTh).closest('table').find('colgroup col')[column.idx]].filter(a => a).forEach(a => a.style = `width:${width}px`);
$(column.nTh).outerWidth(width + "px");
column.sWidth = width + "px";
} Whith onResize: function (column) {
const $wrapper = $table.closest('.dt-layout-table');
const targetWidth = $wrapper.find('.dt-scroll-headInner').width();
$wrapper.find('table').width(targetWidth).css('max-width', `${targetWidth}px`);
} |
Hi @dhobi, @jstark518, @jqnatividad, @Javaman1138 and @hchiam, could you please upgrade this plugin so it can work with DataTable 2.0.0 too?
Thank you.
The text was updated successfully, but these errors were encountered: