Scheduler overlapped events display priority

Show cool things you have done with our products


Post Reply
User avatar
piyanonm
Posts: 14
Joined: Fri Aug 16, 2019 4:29 am

Scheduler overlapped events display priority

Post by piyanonm »

My scheduler has 2 events overlapped with each other. I want to arrange the display priority of the events (which event display in the front or in the back).

Image

I try to sort the events from the priority like this

Code: Select all

	events[0].seq = 2;		// long bar event
	events[1].seq = 1;		// milestone event
	
	// sort event by seq
	events.sort((a, b) => {
		if (a.seq < b.seq) return -1;
		if (a.seq > b.seq) return 1;
		return 0;
	});
, but it didn't work.

I want to display milestone event in the front and log bar event in the back.
Is there a way to prioritize the overlapped events display order?

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 3269
Joined: Wed Jan 08, 2014 11:46 am

Re: Scheduler overlapped events display priority

Post by Maxim Gorkovsky »

Hello.
Before we dive into rendering details, would setting higher z-index solve the issue? You can generate z-index during rendering:

Code: Select all

eventRenderer : ({ tplData }) => {
        tplData.wrapperStyle = `z-index:${Math.round(Math.random() * 100)}`;
    }
    

Post Reply