EditBase
Base class for EventEdit. Not to be used directly.
Configs
16
Configs
16Editor
Default editor configuration, which widgets it shows etc.
This is the entry point into configuring any aspect of the editor.
The items configuration of a Container
is deeply merged with its default items value. This means that you can specify
an editorConfig object which configures the editor, or widgets inside the editor:
const scheduler = new Scheduler({
features : {
eventEdit : {
editorConfig : {
autoClose : false,
modal : true,
cls : 'editor-widget-cls',
items : {
resourceField : {
hidden : true
},
// Add our own event owner field at the top of the form.
// Weight -100 will make it sort top the top.
ownerField : {
weight : -100,
type : 'usercombo',
name : 'owner',
label : 'Owner'
}
},
bbar : {
items : {
deleteButton : false
}
}
}
}
}
});
To configure the editor Panel to be docked, use the drawer config as shown below:
const scheduler = new Scheduler({
features : {
eventEdit : {
// Dock the editor to the inline-end side of the viewport
editorConfig : {
drawer : true
}
}
}
});
True to save and close this panel if ENTER is pressed in one of the input fields inside the panel.
Editor widgets
This config parameter is passed to the startDateField and endDateField constructor.
An object to merge with the provided items config of the editor to override the configuration of provided fields, or add new fields.
To remove existing items, set corresponding keys to null:
const scheduler = new Scheduler({
features : {
eventEdit : {
items : {
// Merged with provided config of the resource field
resourceField : {
label : 'Calendar'
},
recurrenceCombo : null,
owner : {
weight : -100, // Will sort above system-supplied fields which are weight 0
type : 'usercombo',
name : 'owner',
label : 'Owner'
}
}
}
}
});
The provided fields are called
nameFieldresourceFieldstartDateFieldstartTimeFieldendDateFieldendTimeFieldrecurrenceComboeditRecurrenceButton
This config parameter is passed to the startTimeField and endTimeField constructor.
Other
By default, while editing, all clicks outside the editor will cancel the edit.
Set to true to begin editing a new event when an event bar is clicked.
This is normally used in combination with a docked editor, allowing interaction with the scheduler/calendar while editing.
The week start day used in all date fields of the feature editor form by default. 0 means Sunday, 6 means Saturday. Defaults to the locale's week start day.
Misc
Properties
15
Properties
15Common
Class hierarchy
Other
Functions
30
Functions
30Other
Template method, intended to be overridden. Called after the event record has been updated.
| Parameter | Type | Description |
|---|---|---|
eventRecord | EventModel | The event record |
Template method, intended to be overridden. Called before the event record has been updated.
| Parameter | Type | Description |
|---|---|---|
eventRecord | EventModel | The event record |
Configuration
Events
Misc
Events
6
Events
6Fires on the owning Scheduler after editor is closed by any action - save, delete or cancel
// Adding a listener using the "on" method
editBase.on('afterEventEdit', ({ source, action, eventEdit, eventRecord, resourceRecord, eventElement, editor }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | The scheduler |
action | save | delete | cancel | The action that was taken to end the edit. One of 'save', 'delete' or 'cancel' |
eventEdit | EventEdit | The eventEdit feature |
eventRecord | EventModel | The record that has been edited. |
resourceRecord | ResourceModel | The Resource record for the event. If the event is being created, it will not contain a resource, so this parameter specifies the resource the event is being created for. |
eventElement | HTMLElement | The element which represents the event in the scheduler display. |
editor | Popup | The editor |
Event handlers
6
Event handlers
6Called on the owning Scheduler after editor is closed by any action - save, delete or cancel
new EditBase({
onAfterEventEdit({ source, action, eventEdit, eventRecord, resourceRecord, eventElement, editor }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | The scheduler |
action | save | delete | cancel | The action that was taken to end the edit. One of 'save', 'delete' or 'cancel' |
eventEdit | EventEdit | The eventEdit feature |
eventRecord | EventModel | The record that has been edited. |
resourceRecord | ResourceModel | The Resource record for the event. If the event is being created, it will not contain a resource, so this parameter specifies the resource the event is being created for. |
eventElement | HTMLElement | The element which represents the event in the scheduler display. |
editor | Popup | The editor |