Show cool things you have done with our products


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
	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?

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:
eventRenderer : ({ tplData }) => {
        tplData.wrapperStyle = `z-index:${Math.round(Math.random() * 100)}`;
    }
    

Post Reply