Scroll container

Scroll container

trintrintravatrintrintrava Posts: 25Questions: 1Answers: 0

Hello!
Is it possible to make container with table and scrollers flexible by user?
Because now it is static and user can't change it:

"scrollY": 400,
"scrollX": true,

This is problem for me, because users have different display size so table should also be able to be different sizes :)

Thank you :3

Replies

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    See if the solution in this blog does what you want.

    Kevin

  • trintrintravatrintrintrava Posts: 25Questions: 1Answers: 0

    @kthorngren somehow it doesn't work. I am using both ScrollX and ScrollY

  • trintrintravatrintrintrava Posts: 25Questions: 1Answers: 0

    and when I use only ScrollY and comment ScrollX then table become
    endless

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    somehow it doesn't work. I am using both ScrollX and ScrollY

    Can you provide a link to your page or a test case replicating the problem so we can help debug?
    https://datatables.net/manual/tech-notes/10

    If you are trying to recreate the example with the element to drag the table size you will need to use the CSS and div from the page source as noted in the blog:

    In the example above a div element is used as a wrapper around the table and Javascript used to resize the container.

    Kevin

  • trintrintravatrintrintrava Posts: 25Questions: 1Answers: 0

    @kthorgren
    I am trying to do resize here : http://live.datatables.net/geviguge/1/edit
    on the table which you can see down on the right

    I saw that I should use div container but there was nothing about how should I name it or which id should I give to it

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    Here is an example for the blog:
    http://live.datatables.net/katenaga/1/edit

    It has the resize_wrapper div and the resize_handle div plus the CSS for each. It has the event handler for the resize_handle. I added scrollX to show that works.

    Kevin

  • trintrintravatrintrintrava Posts: 25Questions: 1Answers: 0

    @kthorngren thank you very much! It works!

    Do you know if it possible to make it flexible also i horizontal way?

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    Maybe I'm misunderstanding the question but if you enable scrollX the table size should automatically change size with the horizontal container size. You might be able to find techniques to dynamically size a container horizontally on Stack Overflow if thats what you are looking for.

    Kevin

  • trintrintravatrintrintrava Posts: 25Questions: 1Answers: 0

    @kthorngren and maybe if it even possible you know, how to add some space after button "Click and drag me!" so there would be alwways more space to drag?

This discussion has been closed.