ResourceMenu
Feature
Applicable only for Scheduler in vertical mode. Right click resource header cells to display a context menu.
To invoke the menu in a keyboard-accessible manner, use the Space key when a resource cell is focused.
Default menu items
The ResourceMenu feature provides only one item by default:
| Reference | Text | Weight | Description |
|---|---|---|---|
remove |
Delete | 100 | Delete the resource |
Customizing the menu items
The menu items in the resource menu can be customized, existing items can be changed or removed, and new items can be added. This is handled using the items config of the feature.
Add extra items for all columns:
const scheduler = new Scheduler({
mode : 'vertical',
features : {
resourceMenu : {
items : {
extraItem : {
text : 'My cell item',
icon : 'fa fa-bus',
weight : 200,
onItem : () => ...
}
}
}
}
});
Remove an existing item:
const scheduler = new Scheduler({
mode : 'vertical',
features : {
resourceMenu : {
items : {
remove : null
}
}
}
});
Customize existing item:
const scheduler = new Scheduler({
mode : 'vertical',
features : {
resourceMenu : {
items : {
remove : {
text : 'Remove',
icon : 'fa fa-dumpster'
}
}
}
}
});
It is also possible to manipulate the default items and add new items in the processing function:
const scheduler = new Scheduler({
mode : 'vertical',
features : {
resourceMenu : {
processItems({items, record}) {
if (record.cost > 5000) {
items.myItem = { text : 'Split cost' };
}
}
}
}
});
The
processItems implementation may be an async function which awaits a result to mutate the items object.This feature is disabled by default.
Useful configs and functions
| Member | Description |
|---|---|
| resourceMenuBeforeShow | Fires before menu is shown |
| resourceMenuItem | Fires when a menu item is clicked |
| resourceMenuShow | Fires after menu is shown |
See also
- EventMenu - Event context menu
- ScheduleMenu - Schedule context menu
- ResourceModel - Resource data model
No results
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ResourceMenu class, or subclass thereof.
-
Identifies an object as an instance of ResourceMenu class, or subclass thereof.