ResourceModelMixin

Properties

5

Common

Returns all assignments for the resource

initials: Stringreadonly

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

isResourceModelMixin: Boolean= truereadonly
Identifies an object as an instance of ResourceModelMixin class, or subclass thereof.
isResourceModelMixin: Boolean= truereadonlystatic
Identifies an object as an instance of ResourceModelMixin class, or subclass thereof.

Editing

isPersistable: Booleanreadonly

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

Editing

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
ParameterTypeDescription
fieldString | Object

The field to set value for, or an object with multiple values to set in one call

value*

Value to set

silentBoolean

Set to true to not trigger events automatically.

Other

Unassigns this Resource from all its Events

Typedefs

1

Config object used to set different values for top/left and bottom/right margin.

ParameterTypeDescription
startNumber

Margin top in horizontal mode, margin left in vertical mode

endNumber

Margin bottom in horizontal mode, margin right in vertical mode

Fields

13

Common

id: String | Number

Unique identifier

name: String

Get or set resource name

Layout

allowOverlap: Boolean

Set to false to prevent overlapping events for this resource

barMargin: Number

Margin between stacked event bars for this resource, in px.

columnWidth: Number

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.

eventLayout: stack | pack | mixed | none

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
    }
});
rowHeight: Number

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.

eventStyle: tonal | filled | bordered | traced | outlined | indented | line | dashed | minimal | rounded | calendar | interday | gantt | null

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: String | Boolean

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.

imageUrl: String

Fully qualified image URL, used by ResourceInfoColumn and vertical modes ResourceHeader to display a miniature image for the resource.

showAvatar: Boolean

Set to false to not display an avatar for this resource in the ResourceInfoColumn