Show cool things you have done with our products


Post by William »

How to add resources to the scheduler?

Post by pmiklashevich »

Please see our docs & guides: https://www.bryntum.com/docs/scheduler/#guides/data/storebasics.md
scheduler.resourceStore.add({ name : 'Scarlet Witch' });
P.S. Please pick out correct forum next time (Bryntum Scheduler)
Pavel Miklashevich - Core Developer

Post by William »

Can you add resources with mouse click on the web page?

Post by pmiklashevich »

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:
let scheduler = new Scheduler({
    listeners : {
        cellClick : () => {
            scheduler.resourceStore.add({ name : 'New resource' });
        }
    },
But I would recommend to use a context menu, because cellClick/scheduleClick/cellDblClick/scheduleDblClick may interfere with some built-in features, for example:
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

Post by William »

Good advice, thank you !

Post Reply