ResourceModelMixin
Properties
5
Properties
5Common
Returns all assignments for the resource
Returns the initials (first letter of the first & last space-separated word in the name) or an empty string if this resource has no name. You can override this method in a ResourceModel subclass to provide your own implementation
Class hierarchy
Editing
Returns true if the resource can be persisted.
In a flat store, a resource is always considered persistable. In a tree store, a resource is considered
persistable if its parent node is persistable.
Functions
2
Functions
2Editing
Set value for the specified field(s), triggering engine calculations immediately. See Model#set() for arguments.
This does not matter much on the resource itself, but is of importance when manipulating its references:
assignment.set('resourceId', 2);
// resource.assignments is not yet up to date
await assignment.setAsync('resourceId', 2);
// resource.assignments is up to date
| Parameter | Type | Description |
|---|---|---|
field | String | Object | The field to set value for, or an object with multiple values to set in one call |
value | * | Value to set |
silent | Boolean | Set to |
Other
Unassigns this Resource from all its Events
Typedefs
1
Typedefs
1Config object used to set different values for top/left and bottom/right margin.
| Parameter | Type | Description |
|---|---|---|
start | Number | Margin top in horizontal mode, margin left in vertical mode |
end | Number | Margin bottom in horizontal mode, margin right in vertical mode |
Fields
13
Fields
13Layout
Set to false to prevent overlapping events for this resource
Margin between stacked event bars for this resource, in px.
Base width of this resource, in px. If not set, the columnWidth specified in
the Scheduler's configured resourceColumns is used.
This value is used in vertical mode to determine column width.
Specify this to use a resource specific event layout in horizontal mode, see eventLayout for options.
When unset (the default) Schedulers setting is used.
Control how much space to leave between the first event/last event and the resources edge (top/bottom margin within the resource row in horizontal mode, left/right margin within the resource column in vertical mode), in px.
It's also possible to set different values for top/left and bottom/right
by assigning an object to resourceMargin with start (margin top in horizontal mode,
margin left in vertical mode) and end (margin bottom / margin right) properties:
scheduler = new Scheduler({
resourceMargin : {
start : 15,
end : 1
}
});
The base height of this resource, in px. When unset, Schedulers configured rowHeight is used.
This value is used in horizontal mode to determine row height. When stacking, it is used as input for calculating the actual row height:
row.height = (resource.rowHeight - (resourceMargin.start + resourceMargin.end)) * overlap count - barMargin * (overlap count - 1)
When packing or overlapping, it is used as the actual row height.
Styling
Controls the primary color used for events assigned to this resource. Can be overridden per event using EventModels eventColor config. Also, see Schedulers eventColor config.
For available standard colors, see EventColor.
Note: In a TreeStore, leaf nodes inherits their parent´s eventColor if they lack their own color.
Controls the style used for events assigned to this resource. Can be overridden per event using EventModels eventStyle config. See Schedulers eventStyle config for available options.
Image name relative to resourceImagePath,
used by ResourceInfoColumn and vertical modes ResourceHeader to display a miniature image
for the resource.
Set value to false to disable image display.
Fully qualified image URL, used by ResourceInfoColumn and vertical modes ResourceHeader to display a miniature image
for the resource.
Set to false to not display an avatar for this resource in the ResourceInfoColumn