ViewPresetCombo

A combo for selecting ViewPreset for Scheduler and Gantt. Lets the user select between specified presets available.

View preset combo
//<code-header>
fiddle.title = 'View preset combo';
//</code-header>
new Scheduler({
    appendTo : targetElement,

    autoHeight : true,

    resources : [
        { id : 1, name : 'Bernard' },
        { id : 2, name : 'Bianca' }
    ],

    events : [
        { id : 1, resourceId : 1, name : 'Interview', location : 'Office', startDate : '2018-05-07', endDate : '2018-05-10' },
        { id : 2, resourceId : 2, name : 'Meeting', location : 'Client`s office', startDate : '2018-05-10', endDate : '2018-05-12' }
    ],

    tbar : [
        { type : 'viewpresetcombo' }
    ],

    startDate : new Date(2018, 4, 6),
    endDate   : new Date(2018, 4, 13),

    columns : [
        { field : 'name', text : 'Name', width : 100 }
    ]
});

By default, a preset change by the ViewPresetCombo will result in that the startDate will be calculated to the beginning of the mainUnit of the viewportCenterDate. If the ViewPreset has a start configured, this will be added to the calculation. The endDate will then be calculated by adding the ViewPreset's defaultSpan to the startDate. Set useFixedDuration to false to prevent this behaviour.

Add it to the component's toolbar to connect it automatically:

new Scheduler({
   tbar : {
       viewPresetCombo: {
           type: 'viewpresetcombo',
           width: '7em'
       }
   }
});

Or specify which Scheduler, SchedulerPro or Gantt component instance it should connect to the client config:

const scheduler = new Scheduler({ ... });
const viewPresetCombo = new ViewPresetCombo({
    appendTo : 'someElementClassName',
    client   : scheduler
});

By default, the following presets are shown in the combo:

Changing selectable presets

To change the default selectable presets specify an array of preset ids. The presets specified must be available to the client.

viewPresetCombo: {
   presets: ['weekAndDay', 'dayAndMonth', 'myCustomPreset']
}

NOTE: The selectable presets will be arranged in the order provided in the presets config.

Configs

148

Common

editablePickerField
listenersEvents

Other

If not added to a toolbar, provide a Scheduler, SchedulerPro or Gantt component instance to which the ViewPresetCombo should be connected.

presets: Array

An array containing string ViewPreset ids available for selection. The specified presets must be available for the client (Scheduler, SchedulerPro or Gantt) for it to work properly. The selectable presets will be arranged in the order provided here.

As default, a preset change by the ViewPresetCombo will result in that the startDate will be calculated to the beginning of the mainUnit of the viewportCenterDate. If the ViewPreset has a start configured, this will be added to the calculation. The endDate will then be calculated by adding the ViewPreset's defaultSpan to the startDate.

If this is set to false, the preset change will result in a call to zoomToLevel without any options. The default behaviour of zoom functionality is to keep the timespan about the same width. If you want to change ViewPreset/Zoom without any changes to the visible timespan, you can set the zoomKeepsOriginalTimespan config to true.

columnWidget
itemsCombo
listClsCombo
nameField
pickerCombo
renditionTextField
rtlRTL
spanWidget
storeCombo
valueCombo

Accessibility

ariaLabelWidget
keyMapKeyMap

Container

inlineField

CSS

clsWidget
colorWidget
htmlClsWidget
styleWidget
uiWidget

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget
titleWidget

Field

maxLengthTextField
minLengthTextField

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Input element

Label

hintField
labelLabelable
labelClsLabelable
labelPositionLabelable
labelsField
labelWidthLabelable

Layout

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

Misc

badgeBadge
dataFieldWidget
disabledWidget
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
refWidget
rippleWidget
tabWidget
tooltipWidget

Picker

autoExpandPickerField

Scrolling

Properties

97

Class hierarchy

isViewPresetCombo: Boolean= truereadonly
Identifies an object as an instance of ViewPresetCombo class, or subclass thereof.
isViewPresetCombo: Boolean= truereadonlystatic
Identifies an object as an instance of ViewPresetCombo class, or subclass thereof.
isBadgeBadge
isComboCombo
isDelayableDelayable
isEventsEvents
isFieldField
isFormulaFieldFormulaField
isKeyMapKeyMap
isLabelableLabelable
isLocalizableLocalizable
isPickerFieldPickerField
isTextFieldTextField
isValidatableValidatable
isWidgetWidget

Accessibility

keyMapKeyMap

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

badgeBadge
cellInfoWidget
disabledWidget
errorTipValidatable
labelLabelable
localeHelperLocalizable
localeManagerLocalizable
refWidget
tabWidget
tooltipWidget

Other

$namestaticWidget
columnWidget
formulaFormulaField
inputField
isEmptyCombo
isValidField
pickerCombo
queryLaststaticCombo
recordCombo
recordsCombo
renditionTextField
rtlRTL
spanWidget
storeCombo
typestaticWidget
valueCombo

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget

Functions

67

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

clearField
clearErrorValidatable
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getErrorsValidatable
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
selectField
setErrorValidatable
triggerEvents
unEvents
unmaskWidget

Picker

hidePickerPickerField
showPickerPickerField
togglePickerPickerField

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
eachWidgetPickerField
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

20
actionCombo
catchAllEvents
changeField
clearField
destroyEvents
focusInWidget
focusOutWidget
hideWidget
inputCombo
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
selectCombo
showWidget
triggerField

Event handlers

20

Typedefs

7

CSS variables

132