Manual Column Resize Extension
Manual Column Resize Extension
gbfmarc
Posts: 1Questions: 1Answers: 0
Do you have a plan in the future to add a extension where a user can freely resize their columns? or there's an issue why there's still no extension for that?
Answers
No. At this time I've no plans to develop such an extension. Other aspects of DataTables, if feel, need to take priority. That's not to stop anyone else from developing one if they want to though! DataTables is open source.
Allan
You can try the third arty colresize plugin. Not sure if it works with the latest code.
Kevin
Unfortunately, it does not ... updated with Daniel's v1.7.2, but get following error with latest dt:
Uncaught TypeError: Cannot set properties of undefined (setting 'fnColReorder')
at dataTables.colReorder.min.js:6:172
at dataTables.colReorder.min.js:5:283
at dataTables.colReorder.min.js:5:310
Here's link to current (non-working) version ... demo.
And, previous working version ... demo.
Bummer. Will reach out to Daniel, see if he will update.
c
Looks like last compatible dt was v1.13.7 from Nov 23.
v2.0.0 is not.
Apologize. The error above was from colReorder.
The ColResize error is simply:
Warning: ColResize requires DataTables 1.10.8 or greater - www.datatables.net/download.
Here's new link to demo.
It looks like
The check
typeof $.fn.dataTableExt.fnVersionCheck
returnsundefined
so the if statement fails. Looks like the functionfnVersionCheck
has been removed with 2.0.You could try removing the if statement and just using the code inside the if:
However that doesn't mean it will work with Datatables 2.0 . There may be other cases of using private APIs that aren't available in 2.0.
Plus I believe you will need to use the latest buttons 3.0 code with Datatables 2.0. Your test case has buttons 1.5.1. The ColResize plugin may not work with Colvis 3.0. Someone will need to take the time to debug ColResize to make sure it works with Dt 2.0 and Buttons 3.0.
Kevin
Thank you, Kevin. I did update the demo with latest buttons and colvis scripts and css. Will check out your other suggestion soon. c
I'd be extremely surprised if ColResize worked with DataTables 2 and Buttons 3. It is a very old fork of ColReisze and hasn't been updated in years as far as I am aware. It uses legacy API calls (removed in DT2) and the old class names.
It might be possible to update it for DT2, but it isn't something I'm planning on working on myself.
Allan
Hi Allan.
The ColResize we are assessing is not the ColReorderWithResize, which indeed was written years ago.
Daniel Hobi's ColResize plugin was last updated November 2023. It was working fine up through dt 1.13.7.
I've emailed him the issue with dt 2.0.0 ... hoping he will update. It's a really useful plugin and once you get used to the combability to easily adjust column widths, hard to live without!
c
Well, Allan was right of course. Tried Kevin's suggestion of deleting the fnVersionCheck from jquery.dataTables.colResize.js, but no luck ... got rid of error message, but that's it. Will dig a little deeper into Daniel's code, perhaps see other issue(s). Thank again for the help, c
Hi All.
I tried to use colResize extension too, and found one solution. I take this extension colResize and do one change in line 319:
--- that._tableHeaders = that._table.find("thead > tr:first-child > th");
+++ that._tableHeaders = that._table.find("colgroup > col");
and it work for me.
CSS: https://cdn.jsdelivr.net/gh/smasala/ColResize@v2.6.0/css/dataTables.colResize.css
@chimamire_no_tsuki . Thank you. Yes, it works on the table body but not the headers, unfortunately. Here is demo.