ScrollButtons
This feature injects buttons to the beginning and end of each row that will scroll to the next or previous event outside the current view. It can optionally show a label along with the button, using the labelRenderer. Only supported in horizontal mode
new Scheduler({
appendTo : 'container',
features : {
scrollButtons : {
labelRenderer({ resourceRecord, isBefore, nbrEvents }) {
return `${nbrEvents} events`;
}
}
}
//<code-header>
fiddle.title = 'Scroll buttons';
//</code-header>
const scheduler = new Scheduler({
appendTo : targetElement,
// makes scheduler as high as it needs to be to fit rows
autoHeight : true,
tickSize : 60,
startDate : new Date(2024, 2, 20),
columns : [
{ field : 'name', text : 'Name', width : 100 }
],
features : {
scrollButtons : true
},
resources : [
{ id : 1, name : 'George', eventColor : 'blue' },
{ id : 2, name : 'Rob', eventColor : 'green' }
],
events : [
{
id : 1,
name : 'Project X',
startDate : '2024-03-24',
duration : 4,
manuallyScheduled : true,
percentDone : 80
},
{
id : 2,
name : 'Customer Project Y',
startDate : '2024-03-24',
duration : 4,
manuallyScheduled : true,
percentDone : 40
},
{
id : 3,
name : 'Golf tournament',
startDate : '2024-01-28',
manuallyScheduled : true,
duration : 5
},
{
id : 4,
name : 'Meeting',
startDate : '2024-04-29',
duration : 4,
manuallyScheduled : true,
percentDone : 40
}
],
assignments : [
{ id : 1, event : 1, resource : 1 },
{ id : 2, event : 2, resource : 2 },
{ id : 3, event : 3, resource : 1 },
{ id : 4, event : 4, resource : 2 }
]
});This feature is disabled by default.
Configs
13
Configs
13Other
The icon to use for the button scrolling into the past
The icon to use for the button scrolling into the future
A method letting you render a label inside the button.
name. The function encodeHtml as well as
xss can be helpful in these cases.| Parameter | Type | Description |
|---|---|---|
detail | Object | An object that contains data about the event being rendered. |
detail.resourceRecord | ResourceModel | The resource record |
detail.isBefore | Boolean |
|
detail.nbrEvents | Number | The number of events that can be scrolled to |
The text or HTML
A config object describing how the scroll action should be performed.
Misc
Properties
15
Properties
15Common
Class hierarchy
Other
Functions
28
Functions
28Configuration
Events
Misc
Other
Events
6
Events
6Fires on owner when the scroll button is clicked, return false to prevent default scroll behavior
// Adding a listener using the "on" method
scrollButtons.on('scrollButtonClick', ({ domEvent, resourceRecord }) => {
});| Parameter | Type | Description |
|---|---|---|
domEvent | Event | DOM event |
resourceRecord | ResourceModel | The resource record |
Event handlers
6
Event handlers
6Called on owner when the scroll button is clicked, return false to prevent default scroll behavior
new ScrollButtons({
onScrollButtonClick({ domEvent, resourceRecord }) {
}
});| Parameter | Type | Description |
|---|---|---|
domEvent | Event | DOM event |
resourceRecord | ResourceModel | The resource record |
Typedefs
1
Typedefs
1CSS variables
6
CSS variables
6| Name | Description |
|---|---|
--b-scroll-button-border-radius | Scroll button border-radius |
--b-scroll-button-border-width | Scroll button border width |
--b-scroll-button-color | Scroll button color |
--b-scroll-button-background | Scroll button background color |
--b-scroll-button-font-size | Scroll buttons font-size |
| Hovered | |
--b-scroll-button-hover-color | Scroll button hover color |