Split
This feature allows splitting the Scheduler into multiple views, either by using the cell context menu, or programmatically by calling split().
//<code-header>
fiddle.title = 'Split';
//</code-header>
const scheduler = new Scheduler({
appendTo : targetElement,
height : '30em',
startDate : new Date(2023, 4, 22),
endDate : new Date(2023, 5, 30),
features : {
split : true
},
columns : [
{ field : 'name', text : 'Name', width : 100 }
],
resources : ArrayHelper.populate(50, i => ({ id : i, name : `Resource ${i}` }), true),
events : ArrayHelper.populate(200, i => ({ id : i, name : `Event ${i}`, resourceId : i % 50, startDate : new Date(2023, 4, 22, i * 12), duration : 4 }), true)
});
scheduler.split({ direction : 'vertical' });See Split for more details.
Scheduler specifics
- Scheduler allows splitting by dates, either programmatically or by using the context menu.
- Scheduler prevents splitting in the grid part using the context menu.
- The
eventDragfeature will automatically be configured to allow dragging between the clones (by settingconstrainDragToTimelinetofalse). - Splitting is not supported in vertical mode.
This feature is disabled by default. For info on enabling it, see GridFeatures.
Configs
10
Configs
10Other
Properties whose changes should be relayed to sub-views at runtime.
Supply an object with property names as keys, and a truthy value to relay the change, or a falsy value to not relay it. The object will be merged with the default values.
In addition to the properties relayed by Grid, Scheduler also relays these:
Example of supplying a custom set of properties to relay:
const scheduler = new Scheduler({
features : {
split : {
relayProperties : {
barMargin : false, // Do not relay barMargin changes
myConfig : true // Relay changes to the myConfig property
}
}
}
}
Misc
Properties
16
Properties
16Class hierarchy
Other
Functions
30
Functions
30Common
Other
Split the scheduler into two or four parts.
- Splits into two when passed
direction : 'vertical',direction : 'horizontal'oratColumn,atRecordoratDate. - Splits into four when passed
direction : 'both'oratColumn/atDateandatRecord.
// Split horizontally (at the row in the center of the scheduler)
await scheduler.split({ direction : 'horizontal' });
// Split both ways by a specific date and resource
await schedule.split({
atRecord : scheduler.resourceStore.getById(10),
atDate : new Date(2023, 5, 8)
});
To return to a single scheduler, call unsplit.
Note that this function is callable directly on the scheduler instance.
| Parameter | Type | Description |
|---|---|---|
options | Object | Split options |
options.direction | vertical | horizontal | both | Split direction, 'vertical', 'horizontal' or 'both'.
Not needed when passing |
options.atDate | Date | Date to split at. Has to be within the time axis |
options.atColumn | Column | Column to split at |
options.atRecord | Model | Record to split at |
Resolves when split is complete, and subviews are scrolled to the correct position.
Configuration
Events
Misc
Events
7
Events
7Fired when splitting the Scheduler.
// Adding a listener using the "on" method
split.on('split', ({ subViews, options, options.direction, options.atColumn, options.atRecord, options.atDate }) => {
});| Parameter | Type | Description |
|---|---|---|
subViews | SchedulerBase[] | The sub views created by the split |
options | Object | The options passed to the split call |
options.direction | horizontal | vertical | both | The direction of the split |
options.atColumn | Column | The column to split at |
options.atRecord | Model | The record to split at |
options.atDate | Date | The date to split at |
Event handlers
7
Event handlers
7Called when splitting the Scheduler.
new Split({
onSplit({ subViews, options }) {
}
});| Parameter | Type | Description |
|---|---|---|
subViews | SchedulerBase[] | The sub views created by the split |
options | Object | The options passed to the split call |
options.direction | horizontal | vertical | both | The direction of the split |
options.atColumn | Column | The column to split at |
options.atRecord | Model | The record to split at |
options.atDate | Date | The date to split at |