datatable column resize plugin

datatable column resize plugin

dhobidhobi Posts: 2Questions: 2Answers: 0

Hi there,

Since we are using datatables at work and we just needed a resizable column functionality, I've implemented a plugin called 'colResize'. I hope it's good enough to be useful for somebody else as well.

Main features
- Resize columns by mouse drag or touch
- Resizable can be set for each column
- Plugin is able to consider min-width / max-width values of columns
- Can be enabled / disabled / reset programmatically

Live example:
http://live.datatables.net/hafazixi/3

Repository:
https://github.com/dhobi/datatables.colResize

Daniel

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Hi Daniel,

    That's superb! Thank you for sharing that with us. I've added a link to it on the DataTables home page (in the "What's new" section) so others will hopefully see it an benefit from it as well.

    Regards,
    Allan

  • mmahmood2020mmahmood2020 Posts: 1Questions: 0Answers: 0

    Hi @dhobi, We have check your script but when we add a scrollbar in the grid, it stops working. it only allow to resize the header only. This is what we have done in javascript:

    $(document).ready( function () {
    var table = $('#example').DataTable({ "scrollX": true});

    Do you have any suggestion on that?

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    edited December 2020

    @mmahmood2020 You will want to contact the author of the plugin directly for help. Use the Issues option of the plugin's repository:
    https://github.com/dhobi/datatables.colResize

    Likely its not supported as scrollX clones the header to allow for scrolling. The table rows are a separate table and the plugin probably doesn't take this into account. But you will need to check with the developer.

    Kevin

  • amit_queamit_que Posts: 8Questions: 2Answers: 0
    edited June 2021


    Hi @dhobi we are facing resizeColumn issue after recent chrome91 update can you please tell us what could be the possible reason, currently we are unable to resize the columns only the header is resizing but columns remains till the width limit

    It was working fine untill the chrome 91 update

  • amit_queamit_que Posts: 8Questions: 2Answers: 0

    ColReorderWithResize.js file seems to be having issues after chrome 91 update can i get latest nightly build recent file ? or any support for the reported issue

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Have you tried contacting the author through the github repo? The author might not login into this forum often to see these posts. This plugin is not created nor supported by Datatables.

    Kevin

  • tej9928tej9928 Posts: 2Questions: 0Answers: 0

    Hi @dhobi, I'd like to know if this plugin supports RTL (right-to-left languages like Arabic, Hebrew etc). Thanks in advance.

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    edited April 18

    You will need to contact the developer of the plugin. Use the Git Repo for this:
    https://github.com/dhobi/datatables.colResize

    However I'm not sure if the plugin cares about the direction of the language.

    Kevin

  • tej9928tej9928 Posts: 2Questions: 0Answers: 0

    @kthorngren Thanks for your reply :)

Sign In or Register to comment.