SchedulerDatePicker
A subclass of DatePicker which is able to show the presence of events in its cells if configured with an eventStore, and showEvents is set to a truthy value.
The datepicker Widget type is implemented by this class when this class is imported, or built
into a bundle, and so any DateField may have its
picker configured to use its capabilities of showing
the presence of events in its date cells.
cellRenderer to show event presence. If you add a cellRenderer
to a SchedulerDatePicker, showEvents will not work as expected.//<code-header>
fiddle.title = 'Scheduler date picker';
//</code-header>
new Scheduler({
appendTo : targetElement,
height : 400,
width : 600,
resources : [
{ id : 1, name : 'Arnold Smith', image : 'arnold.png' },
{ id : 2, name : 'Gloria Rogers', image : 'gloria.png', eventLayout : 'none' },
{ id : 3, name : 'Jane Miller', eventColor : 'indigo', image : false, eventLayout : 'none' }
],
events : [
{ id : 1, resourceId : 1, name : 'Interview', startDate : '2018-05-06T09:00', endDate : '2018-05-06T10:00' },
{ id : 2, resourceId : 1, name : 'Press meeting', startDate : '2018-05-06T13:00', endDate : '2018-05-06T14:00' },
{ id : 3, resourceId : 2, name : 'Audition', startDate : '2018-05-07T14:00', endDate : '2018-05-07T16:00' },
{ id : 5, resourceId : 3, name : 'Rehearsal', startDate : '2018-05-07T16:00', endDate : '2018-05-07T20:00' },
{ id : 4, resourceId : 2, name : 'Script deadline', startDate : '2018-05-08T10:00', endDate : '2018-05-08T10:00' },
{ id : 6, resourceId : 3, name : 'Rehearsal #2', startDate : '2018-05-08T16:00', endDate : '2018-05-08T19:00' }
],
// Add a datefield to our top toolbar.
// Note how the "picker" is configured to show events, and requires the project's eventStore to do this.
tbar : {
items : {
gotoDate : {
label : 'Jump to',
type : 'datefield',
value : new Date(2018, 4, 6),
inputWidth : '10em',
picker : {
// The eventStore will be linked automatically in this case, but if the picker is not
// used within a Scheduler it might need to be configured separately
// eventStore : myEventStore
showEvents : 'count'
},
listeners : {
change : 'up.onDateSelected'
}
}
}
},
viewPreset : {
base : 'hourAndDay',
tickWidth : 50
},
startDate : new Date(2018, 4, 6, 9),
endDate : new Date(2018, 4, 6, 22),
columns : [
{ field : 'name', text : 'Name', width : 100 }
],
onDateSelected({ value }) {
value.setHours(9);
this.startDate = value;
}
});Configs
148
Configs
148Common
Other
A function, or the name of a function in the ownership hierarchy to filter which events are collected into the day cell data blocks.
Return true to include the passed event, or a falsy value to exclude the event.
| Parameter | Type | Description |
|---|---|---|
event | EventModel | Event for filtering |
Return true to include the passed event
The event store from which the in-cell event presence indicators are drawn.
How to show presence of events in the configured eventStore in the day cells. Values may be:
false- Do not show events in cells.true- Show a themeable bullet to indicate the presence of events for a date.'count'- Show a themeable badge containing the event count for a date.'heatmap'- show warmer background colors the more events are present for a date
Content
CSS
DOM
Float & align
Layout
misc
Misc
Scrolling
Properties
107
Properties
107Class hierarchy
CSS
DOM
Layout
Misc
Other
State
Widget hierarchy
Functions
79
Functions
79Configuration
Events
Misc
Other
Widget hierarchy
Events
27
Events
27Event handlers
27
Event handlers
27Typedefs
7
Typedefs
7CSS variables
103
CSS variables
103| Name | Description |
|---|---|
--b-date-picker-cell-badge-font-size | Font size for badge showing event count |
--b-date-picker-cell-badge-background | Background color for badge showing event count |
--b-date-picker-cell-badge-color | Text color for badge showing event count |
--b-date-picker-cell-badge-size | Size of badge showing event count |
--b-date-picker-1-to-3-events-color | Heatmap color for 1 to 3 events in the date picker. |
--b-date-picker-4-to-6-events-color | Heatmap color for 4 to 6 events in the date picker. |
--b-date-picker-7-or-more-events-color | Heatmap color for 7 or more events in the date picker. |
--b-date-picker-heatmap-background | Heatmap background (a shade of the heatmaps color) |