TaskEditor

Popup used to edit tasks. Normally displayed using the TaskEdit feature.

By default, the editor live updates the task being edited. If you prefer to use buttons to save/cancel the edit, set autoUpdateRecord to false.

Items

By default, it displays the following items:

Ref Type Weight Comment
name text 100 Task name
description textarea 200 Task description
resources resourcescombo 300 Assigned resources
color taskcolorcombo 400 Task eventColor
column columncombo 500 Bound to configured columnField
swimlane swimlanecombo 600 Bound to configured swimlaneField

If configured with autoUpdateRecord: false it also displays a bottom toolbar with the following items:

Ref Type Weight Comment
saveButton button 100 Save
cancelButton button 200 Cancel

Customization

Popup and its items can be customized through the feature (see TaskEdit fore more info):

Task editor customized
//<code-header>
fiddle.title = 'Task editor customized';
//</code-header>
const taskBoard = new TaskBoard({
    appendTo : targetElement,

    features : {
        taskEdit : {
            // Config used to create the editor
            editorConfig : {
                // Will make it anchor to the task being edited
                centered : false,
                // Display it without masking the rest of the page
                modal    : false
            },

            // Affect the editors items
            items : {
                // Change the label for the name field
                name        : { label : 'Title' },
                // Hide description, color and column
                description : null,
                color       : null,
                column      : null
            }
        }
    },

    // Url for resource avatar images
    resourceImagePath : 'data/Grid/images/transparent-users/',

    // Columns to display
    columns : [
        'todo',
        'doing',
        'done'
    ],

    // Field used to pair a task to a column
    columnField : 'status',

    // Project using inline data
    project : {
        tasks : [
            { id : 1, name : 'Double click me', status : 'doing' },
            { id : 2, name : 'Or me', status : 'doing' }
        ],

        resources : [
            { id : 1, name : 'Angelo', image : 'angelo.png' },
            { id : 2, name : 'Celia', image : 'celia.png' },
            { id : 3, name : 'Dave', image : 'dave.png' },
            { id : 4, name : 'Emilia', image : 'emilia.png' }
        ],

        assignments : [
            { id : 1, event : 1, resource : 1 },
            { id : 2, event : 2, resource : 3 }
        ]
    }
});

Or by subclassing and instructing the feature to display the new editor:

Task editor subclassed
//<code-header>
fiddle.title = 'Task editor subclassed';
//</code-header>
// The if-statement is to make it register only once in the docs browser,
// not needed in an actual application
if (!Widget.resolveType('mytaskeditor', true)) {
    // Subclass TaskEditor
    class MyTaskEditor extends TaskEditor {
        static type = 'mytaskeditor';

        static configurable = {
            // Changed title
            title : 'Custom task editor',

            // Will make it anchor to the task being edited
            centered : false,

            // Display it without masking the rest of the page
            modal : false,

            items : {
                // Change the label for the resources field
                resources   : { label : 'Assigned' },
                // Hide description, color and column
                description : null,
                color       : null,
                column      : null
            }
        };
    }

    // Register the type of the subclass (mytaskeditor)
    MyTaskEditor.initClass();
}

const taskBoard = new TaskBoard({
    appendTo : targetElement,

    features : {
        taskEdit : {
            // Use the custom task editor by supplying its type
            editorType : 'mytaskeditor'
        }
    },

    // Url for resource avatar images
    resourceImagePath : 'data/Grid/images/transparent-users/',

    // Columns to display
    columns : [
        'todo',
        'doing',
        'done'
    ],

    // Field used to pair a task to a column
    columnField : 'status',

    // Project using inline data
    project : {
        tasks : [
            { id : 1, name : 'Double click me', status : 'doing' },
            { id : 2, name : 'Or me', status : 'doing' }
        ],

        resources : [
            { id : 1, name : 'Angelo', image : 'angelo.png' },
            { id : 2, name : 'Celia', image : 'celia.png' },
            { id : 3, name : 'Dave', image : 'dave.png' },
            { id : 4, name : 'Emilia', image : 'emilia.png' }
        ],

        assignments : [
            { id : 1, event : 1, resource : 2 },
            { id : 2, event : 2, resource : 4 }
        ]
    }
});

Configs

122

Common

autoUpdateRecord: Boolean= true

By default the editor automatically updates the edited task when a field is changed. Set this to false to show Save / Cancel buttons and take manual control of the updating.

centered: Boolean= true

Center the editor in browser viewport space. Defaults to true for desktop browsers using a pointer device

closable: Boolean= true

Shows a tool used to close the editor in the header.

modal: Boolean= true

Show an opaque mask below the editor when shown.

Clicking the mask closes the editor.

saveAndCloseOnEnter: Boolean= true

True to save and close the editor if ENTER is pressed. (The save part only applies when configured with autoUpdateRecord : false)

ENTER with any modifier key (Shift/Ctrl etc) will not close the editor.

listenersEvents

Other

Update fields if the record changes

columnWidget
defaultFocusContainer
drawerPanel
labelPositionContainer
renditionContainer
resizableResizable
rtlRTL
spanWidget

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
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

Record

recordContainer

Scrolling

State

stateIdState

Properties

98

Class hierarchy

isTaskEditor: Boolean= truereadonly
Identifies an object as an instance of TaskEditor class, or subclass thereof.
isTaskEditor: Boolean= truereadonlystatic
Identifies an object as an instance of TaskEditor class, or subclass thereof.
isContainerContainer
isDelayableDelayable
isEventsEvents
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
valuesContainer

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

26

Fires on the owning TaskBoard when user clicks 'Cancel'. Returning false from a listener prevents canceling and keeps the editor open.

// Adding a listener using the "on" method
taskEditor.on('beforeCancel', ({ source, editor }) => {

});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

Fires on the owning TaskBoard when user clicks Save, before changes are saved. Returning false from a listener prevents saving and keeps the editor open.

// Adding a listener using the "on" method
taskEditor.on('beforeSave', ({ source, editor, record, values }) => {

});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

recordTaskModel

The task record

valuesObject

The task editor field values

Fires on the owning TaskBoard when user clicks 'Cancel', after the editor closed.

// Adding a listener using the "on" method
taskEditor.on('cancel', ({ source, editor }) => {

});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

Fires on the owning TaskBoard when user clicks Save, after changes are saved.

// Adding a listener using the "on" method
taskEditor.on('save', ({ source, editor, record, values }) => {

});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

recordTaskModel

The task record

valuesObject

The task editor field values

catchAllEvents
destroyEvents
expandPanel
focusInWidget
focusOutWidget
hideWidget
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
showWidget

Event handlers

26

Called on the owning TaskBoard when user clicks 'Cancel'. Returning false from a listener prevents canceling and keeps the editor open.

new TaskEditor({
    onBeforeCancel({ source, editor }) {

    }
});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

Called on the owning TaskBoard when user clicks Save, before changes are saved. Returning false from a listener prevents saving and keeps the editor open.

new TaskEditor({
    onBeforeSave({ source, editor, record, values }) {

    }
});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

recordTaskModel

The task record

valuesObject

The task editor field values

Called on the owning TaskBoard when user clicks 'Cancel', after the editor closed.

new TaskEditor({
    onCancel({ source, editor }) {

    }
});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

Called on the owning TaskBoard when user clicks Save, after changes are saved.

new TaskEditor({
    onSave({ source, editor, record, values }) {

    }
});
ParameterTypeDescription
sourceTaskBoard

The taskboard

editorTaskEditor

The editor

recordTaskModel

The task record

valuesObject

The task editor field values

onDestroyEvents
onFocusInWidget
onHideWidget
onPaintWidget
onResizeWidget
onShowWidget

Typedefs

7

CSS variables

60