Skip to content
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

Feature request: scroll table #87

Open
adaoduque opened this issue Nov 9, 2017 · 5 comments
Open

Feature request: scroll table #87

adaoduque opened this issue Nov 9, 2017 · 5 comments

Comments

@adaoduque
Copy link

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

Thank you.

@championcp
Copy link

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.

@alvaro-prieto
Copy link
Owner

alvaro-prieto commented Apr 29, 2018

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!

@championcp
Copy link

championcp commented Apr 30, 2018

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

@FeliciaLFF
Copy link

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

@FeliciaLFF
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants