SchedulerExportDialog

Extends the Grid's ExportDialog and adds a few extra fields specific to the scheduler.

Default widgets

The default widgets of this dialog are:

Widget ref Type Weight Description
columnsField Combo 100 Choose columns to export
scheduleRangeField Combo 150 Choose date range to export
rangesContainer Container 151 Container for range fields
>rangeStartField DateField 10 Choose date range start
>rangeEndField DateField 30 Choose date range end
rowsRangeField Combo 200 Choose which rows to export
exporterTypeField Combo 300 Type of the exporter to use
alignRowsField Checkbox 400 Align row top to the page top on every exported page
repeatHeaderField Checkbox 500 Toggle repeating headers on / off
fileFormatField Combo 600 Choose file format
paperFormatField Combo 700 Choose paper format
orientationField Combo 800 Choose orientation
>
first level of submenu

The default buttons are:

Widget ref Type Weight Description
exportButton Button 100 Triggers export
cancelButton Button 200 Cancel export

Configuring default widgets

Widgets can be customized with exportDialog config:

const scheduler = new Scheduler({
    features : {
        pdfExport : {
            exportDialog : {
                items : {
                    // hide the field
                    orientationField  : { hidden : true },

                    // reorder fields
                    exporterTypeField : { weight : 150 },

                    // change default format in exporter
                    fileFormatField   : { value : 'png' },

                    // Configure nested fields
                    rangesContainer : {
                        items : {
                            rangeStartField : { value : new Date() },
                            rangeEndField : { value : new Date() }
                        }
                    }
                }
            }
        }
    }
});

scheduler.features.pdfExport.showExportDialog();

Using DateTime fields for range start/end

This config system is also capable (but not limited to) of changing layout of the container and replacing widget type:

const scheduler = new Scheduler({
    features : {
        pdfExport : {
            exportDialog : {
                items : {
                    rangesContainer : {
                        // DateTime fields are longer, so we better lay them out
                        // vertically
                        layoutStyle : {
                            flexDirection : 'column'
                        },
                        items : {
                            rangeStartField : {
                                // Use DateTime widget for ranges
                                type       : 'datetime',

                                // Sync label width with other fields
                                labelWidth : '12em'
                            },
                            rangeEndField : {
                                type       : 'datetime',
                                labelWidth : '12em'
                            },
                            // Add a filler widget that would add a margin at the bottom
                            filler : {
                                height : '0.6em',
                                weight : 900
                            }
                        }
                    }
                }
            }
        }
    }
});

Configuring default columns

By default all visible columns are selected in the export dialog. This is managed by autoSelectVisibleColumns config. To change default selected columns you should disable this config and set field value. Value should be an array of valid column ids (or column instances). This way you can preselect hidden columns:

const scheduler = new Scheduler({
    columns : [
        { id : 'name', text : 'Name', field : 'name' },
        { id : 'age', text : 'Age', field : 'age' },
        { id : 'city', text : 'City', field : 'city', hidden : true }
    ],
    features : {
        pdfExport : {
            exportDialog : {
                autoSelectVisibleColumns : false,
                items : {
                    columnsField : { value : ['name', 'city'] }
                }
            }
        }
    }
})

// This will show export dialog with Name and City columns selected
// even though City column is hidden in the UI
scheduler.features.pdfExport.showExportDialog();

Adding fields

You can add your own fields to the export dialog. To make such field value acessible to the feature it should follow naming pattern - it should have ref config ending with Field, see other fields for reference - orientationField, columnsField, etc. Fields not matching this pattern are ignored. When values are collected from the dialog, Field part of the widget reference is removed, so orientationField becomes orientation, fooField becomes foo, etc.

const grid = new Grid({
    features : {
        pdfExport : {
            exportDialog : {
                items : {
                    // This field gets into export config
                    fooField : {
                        type : 'text',
                        label : 'Foo',
                        value : 'FOO'
                    },

                    // This one does not, because name doesn't end with `Field`
                    bar : {
                        type : 'text',
                        label : 'Bar',
                        value : 'BAR'
                    },

                    // Add a container widget to wrap some fields together
                    myContainer : {
                        type : 'container',
                        items : {
                            // This one gets into config too despite the nesting level
                            bazField : {
                                type : 'text',
                                label : 'Baz',
                                value : 'BAZ'
                            }
                        }
                    }
                }
            }
        }
    }
});

// Assuming export dialog is opened and export triggered with default values
// you can receive custom field values here
grid.on({
    beforePdfExport({ config }) {
        console.log(config.foo) // 'FOO'
        console.log(config.bar) // undefined
        console.log(config.baz) // 'BAZ'
    }
});

Configuring widgets at runtime

If you don't know column ids before grid instantiation or you want a flexible config, you can change widget values before dialog pops up:

const scheduler = new Scheduler({
    columns : [
        { id : 'name', text : 'Name', field : 'name' },
        { id : 'age', text : 'Age', field : 'age' },
        { id : 'city', text : 'City', field : 'city', hidden : true }
    ],
    features : {
        pdfExport : true
    }
});

// Such listener would ignore autoSelectVisibleColumns config. Similar to the snippet
// above this will show Name and City columns
scheduler.features.pdfExport.exportDialog.on({
    beforeShow() {
        this.widgetMap.columnsField.value = ['age', 'city']
    }
});

Configs

124

Common

listenersEvents

Accessibility

ariaLabelWidget
keyMapKeyMap

Content

bbarPanel
defaultsContainer
footerPanel
headerPanel
itemsContainer
lazyItemsContainer
namedItemsContainer
stripsPanel
tbarPanel
textContentContainer
toolsPanel

CSS

bodyClsPanel
borderContainer
clsWidget
colorWidget
htmlClsWidget
itemClsContainer
styleWidget
uiPanel

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget

Float & align

alignWidget
anchorWidget
centeredWidget
floatingWidget
xWidget
yWidget

Layout

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

misc

tabBarItemsContainer

Misc

dataFieldWidget
disabledWidget
iconPanel
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
readOnlyWidget
refWidget
rippleWidget
tabWidget
titlePanel
tooltipWidget

Other

clientExportDialog
columnWidget
defaultFocusContainer
drawerPanel
labelPositionContainer
modalPopup
renditionContainer
resizableResizable
rtlRTL
spanWidget
useBrowserPrintExportDialog

Record

recordContainer

Scrolling

State

stateIdState

Properties

100

Class hierarchy

isSchedulerExportDialog: Boolean= truereadonly
Identifies an object as an instance of SchedulerExportDialog class, or subclass thereof.
isSchedulerExportDialog: Boolean= truereadonlystatic
Identifies an object as an instance of SchedulerExportDialog class, or subclass thereof.
isContainerContainer
isDelayableDelayable
isEventsEvents
isExportDialogExportDialog
isKeyMapKeyMap
isLocalizableLocalizable
isPanelPanel
isPopupPopup
isResizableResizable
isStateState
isToolableToolable
isWidgetWidget

Accessibility

keyMapKeyMap

Content

bbarPanel
tbarPanel

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
layoutContainer
layoutStyleContainer
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

cellInfoWidget
disabledWidget
localeHelperLocalizable
localeManagerLocalizable
readOnlyWidget
refWidget
tabWidget
titlePanel
tooltipWidget

Other

$namestaticWidget
columnWidget
firstItemContainer
hasChangesContainer
isValidContainer
itemsContainer
labelPositionContainer
lastItemContainer
renditionContainer
resizableResizable
rtlRTL
spanWidget
toolsPanel
typestaticWidget
useBrowserPrintExportDialog
valuesExportDialog

Record

recordContainer

State

stateState

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget
widgetMapContainer

Functions

75

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

addContainer
closePopup
composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
getAtContainer
getWidgetByIdContainer
insertContainer
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
removeContainer
removeAllContainer
resetValuesContainer
setValuesContainer
triggerEvents
unEvents
unmaskWidget

State

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

24
cancelExportDialog
catchAllEvents
destroyEvents
expandPanel
exportExportDialog
focusInWidget
focusOutWidget
hideWidget
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
showWidget

Event handlers

24

Typedefs

7

CSS variables

60