colResizable icon indicating copy to clipboard operation
colResizable copied to clipboard

Feature request: scroll table

Open adaoduque opened this issue 8 years ago • 5 comments

I would like support scrollbar in the body of the table.

Thank you.

adaoduque avatar Nov 09 '17 14:11 adaoduque

I met the same situation. when using colresizable in a scrolling table, the header column of the table can not be dragged.

  • The runtime strutcture of scrolling table is like this:
<div class="dataTables_scroll">
    <div class="dataTables_scrollHead">
        <div class="dataTables_scrollHeadInner">
          <table class="display dataTable no-footer"></table>
        </div>
    </div>
    <div class="dataTables_scrollBody" style="position: relative; overflow:auto;width:100%;height:703px;">
        <table id="dataTables" class="display dataTable no-footer JPadding JColResizer JCLRFlex"></table>
    </div>
</div>
  • I use the following code to init the colresizable:
$(function(){
  $("#dataTables").colResizable();
});

While dragging the column of "dataTables_scrollBody", the header column of "dataTables_scrollHead" is not changed.

championcp avatar Apr 28 '18 11:04 championcp

Thank you for your suggestion @adaoduque I already thought about that in the past but in the end I prefer to keep it simple. It is not a datatable plugin (there are others plugins doing so and I can not compete with them), it is just a column resizing one. I've spent a lot of time with this piece of code in the past and I don't get much in exchange, so probably this is not going to happen soon.

@championcp Of course it is not changed in your example, that is the expected behaviour because there are 2 tables. However its very easy to extend the behaviour yourself. You can apply colresizable to the header table, capture the onResize event and apply the same widths to the second table using JS. Fast and easy. Good luck!

alvaro-prieto avatar Apr 29 '18 16:04 alvaro-prieto

@alvaro-prieto Thanks a lot, and I will try soon.

championcp avatar Apr 30 '18 01:04 championcp

@championcp 你好请问实现可以了吗

FeliciaLFF avatar Aug 14 '19 08:08 FeliciaLFF

@alvaro-prieto 如何使用JS将相同的宽度应用于第二个表

FeliciaLFF avatar Aug 14 '19 09:08 FeliciaLFF