MonthPicker
A Panel subclass which allows the selection of a month.
The month indicates and sets the currently selected month.
The select event is fired with a 0-indexed value when a different month is selected.
The titleClick event is fired when the panel title is clicked.
//<code-header>
fiddle.title = 'Month picker';
//</code-header>
const picker = new MonthPicker({
appendTo : targetElement,
width : '24em',
listeners : {
select : ({ value }) => {
Toast.show(`You picked ${value}`);
},
titleClick : () => Toast.show('You clicked the title bar')
}
});Configs
109
Configs
109Common
Other
The month to use as the selected month (zero-based, 0-11). Defaults to the current month.
Content
CSS
DOM
Float & align
Layout
misc
Misc
Scrolling
Properties
95
Properties
95Class hierarchy
Other
The month to use as the selected month (zero-based, 0-11). Defaults to the current month.
CSS
DOM
Layout
Misc
State
Widget hierarchy
Functions
74
Functions
74Configuration
Events
Misc
Other
Widget hierarchy
Events
23
Events
23Fired when a month is selected.
// Adding a listener using the "on" method
monthPicker.on('select', ({ value, source }) => {
});| Parameter | Type | Description |
|---|---|---|
value | Number | The previously selected month. |
source | MonthPicker | This MonthPicker |
Fires when the month title of this Panel is clicked.
// Adding a listener using the "on" method
monthPicker.on('titleClick', ({ source, event }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Button | The clicked button |
event | Event | DOM event |
Event handlers
23
Event handlers
23Called when a month is selected.
new MonthPicker({
onSelect({ value, source }) {
}
});| Parameter | Type | Description |
|---|---|---|
value | Number | The previously selected month. |
source | MonthPicker | This MonthPicker |
Called when the month title of this Panel is clicked.
new MonthPicker({
onTitleClick({ source, event }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Button | The clicked button |
event | Event | DOM event |