Manual Column Resize Extension

Manual Column Resize Extension

gbfmarcgbfmarc Posts: 1Questions: 1Answers: 0
edited November 2022 in Free community support

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

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    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

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    You can try the third arty colresize plugin. Not sure if it works with the latest code.

    Kevin

  • chboccachbocca Posts: 86Questions: 13Answers: 1
    edited February 25

    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

  • chboccachbocca Posts: 86Questions: 13Answers: 1
    edited February 25

    Looks like last compatible dt was v1.13.7 from Nov 23.

    v2.0.0 is not.

  • chboccachbocca Posts: 86Questions: 13Answers: 1
    edited February 25

    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.

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    It looks like

        // Register a new feature with DataTables
        if (typeof $.fn.dataTable == "function" &&
            typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
            $.fn.dataTableExt.fnVersionCheck('1.10.8')) {
            $.fn.dataTableExt.aoFeatures.push({
    

    The check typeof $.fn.dataTableExt.fnVersionCheck returns undefined so the if statement fails. Looks like the function fnVersionCheck has been removed with 2.0.

    You could try removing the if statement and just using the code inside the if:

    $.fn.dataTableExt.aoFeatures.push( ... );
    

    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

  • chboccachbocca Posts: 86Questions: 13Answers: 1

    Thank you, Kevin. I did update the demo with latest buttons and colvis scripts and css. Will check out your other suggestion soon. c

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    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

  • chboccachbocca Posts: 86Questions: 13Answers: 1
    edited February 27

    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

  • chboccachbocca Posts: 86Questions: 13Answers: 1
    edited February 29

    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

Sign In or Register to comment.