search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

React Scheduler > Sticky time header (1st group only for now) on horizontal scroll

Asked by Andy
1 day ago.

Hello,

I am having some difficulty trying to get the content of the 1st time header group sticky while horizontally scrolling. In this case, we should see `Nov` sticky to the right of the left pane, instead of hidden behind it.

Can you provide some guidance?

I am using `onBeforeTimeHeaderRender` for applying class to the time header group (for distinguishing groups) and `onBeforeTimeHeaderDomAdd` for rendering actual content.

I saw this question https://forums.daypilot.org/question/5093/sticky-time-header-on-javascript-scheduler , but that seems to apply to vertical scroll.

Thank you!

Answer posted by Dan Letecky [DayPilot]
1 day ago.

This is what Floating Time Headers feature does. It should be enabled by default, so it looks like you might have turned it off.

Comment posted by Andy
1 day ago.

Hi Dan,

You are right. It was turned off due to this issue https://forums.daypilot.org/question/6710/scheduler-shows-different-values-than-what-being-rendered-b.

Do you have advice on how to go about this with css, since we render the time header using JSX?

Comment posted by Dan Letecky [DayPilot]
1 day ago.

Hi Andy,

You can provide the floating content (using args.header.text or args.header.html) in addition to the JSX. But as I see in your screenshot, the content isn’t too complex, so it might be easier to switch from JSX to plain HTML for the standard content as well.

Comment posted by Andy
1 day ago.

Hi Dan,

There are future specs where we will need complex rendering (the current version in the screenshot is just the first version of our timeline feature) - hence we intentionally set it up to render JSX.

As for your advice, are you referring to something like this?

// Current 
onBeforeTimeHeaderDomAdd(args) {
  args.element = <TimeHeaderComponent />;
}

// To be added
onBeforeTimeHeaderRender(args) {
  args.header.text/html = <TimeHeaderComponent />;
}
Comment posted by Dan Letecky [DayPilot]
1 day ago.

Hi Andy,

Thanks for the update.

At this moment, only raw HTML would work. But please let me check if it is possible to inject the existing JSX into the floating headers. I’ll keep you updated.

Comment posted by Andy
23 hours ago.

Thank you, Dan!

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):