≡

[FixedHeader] Feature request: should support a custom scroll container

[FixedHeader] Feature request: should support a custom scroll container

sctannersctanner Posts: 4Questions: 1Answers: 0

Hi DataTables team,
We are using FixedHeader 4.0.1 in an app shell where the browser window does not own vertical scrolling. Instead, our layout scrolls inside an internal container:
main.app-main, section.main-scroll { overflow-y: auto; }
It would be very helpful if FixedHeader supported a config option for a custom scroll container, for example:
fixedHeader: { header: true, scrollContainer: 'main.app-main' }
or
fixedHeader: { header: true, scrollContainer: document.querySelector('.main-scroll') }

Expected behavior: FixedHeader listens to that element’s scroll events and computes header position relative to that scroll container rather than window.

Thank you for the consideration

Replies

  • allanallan Posts: 66,060Questions: 1Answers: 10,999 Site admin

    Hi,

    Agreed - many thanks for the suggestion. I've got it on my to do list, but haven't yet managed to focus on that specific feature. I'll try to get to it sooner rather than later :)

    Allan

  • sctannersctanner Posts: 4Questions: 1Answers: 0

    Thanks Allan. We look forward to it.

  • sctannersctanner Posts: 4Questions: 1Answers: 0

    I did want to note that:
    I tried to do custom implementation for this, telling the headers to recalculate their position on scroll trhough js. This worked, however it made columnControls open in the wrong position, meaning we'd also have to recalculate that, and there are probably other bug cases I did not find. Just something to consider. Thanks!

  • allanallan Posts: 66,060Questions: 1Answers: 10,999 Site admin

    That's a good one - thanks. Yes, I'm sure there are a number of things that will be impacted.

    Allan

Sign In or Register to comment.