How to add resources to the scheduler?
How to add resources to the scheduler?
How to add resources to the scheduler?
- pmiklashevich
- Core Developer
- Posts: 3450
- Joined: Fri Apr 01, 2016 11:08 am
Re: Scheduler
Please see our docs & guides: https://www.bryntum.com/docs/scheduler/#guides/data/storebasics.md
P.S. Please pick out correct forum next time (Bryntum Scheduler)
Code: Select all
scheduler.resourceStore.add({ name : 'Scarlet Witch' });
Pavel Miklashevich - Core Developer
Re: How to add resources to the scheduler?
Can you add resources with mouse click on the web page?
- pmiklashevich
- Core Developer
- Posts: 3450
- Joined: Fri Apr 01, 2016 11:08 am
Re: How to add resources to the scheduler?
It's not supported out of the box, but can be easily implemented. You just need a button, a contextmenu item, or listen to a click/dbclick.
For example, cellClick event:
But I would recommend to use a context menu, because cellClick/scheduleClick/cellDblClick/scheduleDblClick may interfere with some built-in features, for example:
For example, cellClick event:
Code: Select all
let scheduler = new Scheduler({
listeners : {
cellClick : () => {
scheduler.resourceStore.add({ name : 'New resource' });
}
},
Code: Select all
let scheduler = new Scheduler({
features : {
contextMenu : {
cellItems : [{
text : 'Add new resource',
icon : 'b-fa b-fa-plus',
weight : 200,
onItem : () => {
scheduler.resourceStore.add({ name : 'New resource' });
}
}]
}
},
Pavel Miklashevich - Core Developer
Re: How to add resources to the scheduler?
Good advice, thank you !