Using "scroller" in a responsive layout?

Using "scroller" in a responsive layout?

hemshems Posts: 1Questions: 1Answers: 0

I would like to know how to set the ScrollY using % or how to update it dynamically using javascript.

It seems that an option would be to initiate .dataTable() again, but that seems to reset the position of the scroll.

Another option would be to update CSS properties "manually" on the masking div, and then ask Scroller to recalculate ( is this option available? ).

Thank you.

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    You can't set it to be a percentage value, however, have a look at this blog post which presents a plug-in for DataTables that will fit the scrolling element to fit in the container element.

    Allan

  • MikeSMikeS Posts: 113Questions: 1Answers: 0

    I'm having a similar issue. I have a datatable using scrollY displayed in a bootstrap 3 modal dialog. The dialog resizes both its width and height when the browser window resizes. I'd like to have the datatable also resize when the modal resizes. It works mostly except that I can't find a way to make the scrollY value dynamically change.

    I've looked a the blog post example and there are limitations set that I don't use or need. Those being paging options are required in order for the plugin to work.

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    I'm sure the technique used in the blog post can be reused relatively easily to apply to the scrolling container. I've got a massive backlog at the moment so it will be a while before I look at it myself, but I've added it to my list.

    Allan

This discussion has been closed.