Our pure JavaScript Scheduler component


Post by DevMeData »

Hi everyone,

unfortunately we have two small problems with the scheduler regarding the context menu.

Deactivate the context menu:
Based on the documentation, we were able to deactivate the context menu for the timeline. Is it possible to deactivate the context menu for the resources as well?
We only found how the context menu for the events and the scheduler could still be deactivated.

[eventMenuFeature]="schedulerConfig.eventMenu"
[scheduleMenuFeature]="schedulerConfig.eventMenu"
[timeAxisHeaderMenuFeature]="schedulerConfig.isContextMenuForTimeline"

Edit the context:
However, a context menu must be available for normal events and in the scheduler.
As described in the documentation, we edit the context menu for the events and the scheduler.

processItems({ items }) {
	console.log(items);
},
items: {
	testA: {
		text: 'Test A',
		cls: 'b-separator',
		weight: 510,
		onItem({ eventRecord, resourceRecord }) {
			console.log("EventRecord: ", eventRecord);
			console.log("ResourceRecord: ", resourceRecord);
		}
	},
	testB: {
		text: 'Test B',
		weight: 520,
		onItem({ eventRecord, resourceRecord }) {
			console.log("EventRecord: ", eventRecord);
			console.log("ResourceRecord: ", resourceRecord);
		}
	},
	// Hide built in items, we create our own
	deleteEvent: false,
	addEvent: false,
	editEvent: false,
	cutEvent: false,
	copyEvent: false,
}

The problem:
The individual entries must be activated or deactivated depending on the type of event.
However, we do not have access to the clicked event via the ProcessItems. Is there a way to do this?

Many thanks in advance

Best regards


Post by Animal »

See the docs for processItems. All the contextual information you might need is passed: https://www.bryntum.com/docs/scheduler/#Scheduler/feature/EventMenu#config-processItems:

Screenshot 2021-07-26 at 09.06.29.png
Screenshot 2021-07-26 at 09.06.29.png (120.1 KiB) Viewed 386 times

Post by DevMeData »

Hey,

thanks for your answer. It works perfectly.
I thought this was only possible for the built-in items.

Right now it is possible to open the contextmenu on the ressources aswell.
Maybe im blind here, but is there the option to disable it like we did it for e.g. the timeline?

[timeAxisHeaderMenuFeature]="schedulerConfig.isContextMenuForTimeline"

Greetings


Post by saki »

You can set

[cellMenuFeature] = "schedulerConfig.cellMenuFeature"

where schedulerConfig.cellMenuFeature would be boolean false.


Post by DevMeData »

Hi Saki,
thanks, it works.

Solved.

Greets


Post Reply