ResourceEdit

Feature that displays a popup containing widgets for editing resource data.

This feature is enabled by default.

Customizing the editor

Please check ResourceEditor docs for details on its controls. And this is how the editor controls can be customized:

new ResourceGrid({
    ...
    features : {
        resourceEdit : {
            // configure the editor
            editorConfig : {
                items : {
                    mainTabs : {
                        items : {
                            // change "General" tab controls
                            generalTab : {
                                items : {
                                    // rename "Name" field label to "Foo"
                                    nameField : {
                                        label : 'Foo'
                                    },
                                    // add new "Age" field
                                    ageField : {
                                        type  : 'number',
                                        label : 'Age',
                                        field : 'age'
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
});

The editor contains tabs by default. Each tab is a container with built-in widgets: text fields, grids, etc.

Tab ref Text Weight Class Description
generalTab General 100 ResourceEditorGeneralTab Name, start/end dates, duration, percent done, effort
rateTablesTab Costs 200 ResourceEditorRateTablesTab Grid with incoming dependencies

General tab items

Widget ref Weight Class Description
nameField 10 TextField Resource name field
typeField 20 ResourceTypeField Resource type field
maxUnits 30 NumberField Resource maximum effort in percent field
materialLabel 40 TextField Material resource label field
costAccrual 50 CostAccrualField Resource cost accrual field
calendarField 60 CalendarField Material calendar field

Costs tab items

Widget ref Weight Class Description
rateTableCombo 10 ModelCombo Rate table field
addGroupButton 20 Button Add rate table button
removeGroupButton 30 Button Remove rate table button
useByDefaultCheckbox 40 Checkbox Use the selected rate table by default checkbox
rateTablePanel 50 ResourceRateTableContainer A panel with the selected rate table info
defaultRateTable - Field A hidden field containing the resource default rate table

Configs

10

Common

disabledInstancePlugin
listenersEvents

Other

A configuration object applied to the internal ResourceEditor.

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

18

Common

disabledInstancePlugin

Class hierarchy

isResourceEdit: Boolean= truereadonly
Identifies an object as an instance of ResourceEdit class, or subclass thereof.
isResourceEdit: Boolean= truereadonlystatic
Identifies an object as an instance of ResourceEdit class, or subclass thereof.
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable

Other

Returns the editor widget representing this feature

isEditing: Booleanreadonly

Returns true if the editor is currently active

The current ResourceModel record, which is being edited by the editor.

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Functions

29

Other

Opens an editor for the passed resource. This function is exposed on grid and can be called as grid.editResource().

ParameterTypeDescription
resourceRecordResourceModel

Resource to edit

LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Events

10

Fires on the owning grid before a resource editing starts. This may be listened for to allow an application to take over event editing duties. Returning false stops the default editing UI from being shown.

// Adding a listener using the "on" method
resourceEdit.on('beforeResourceEdit', ({ source, resourceEdit, resourceRecord }) => {

});
ParameterTypeDescription
sourceResourceGrid

The grid instance

resourceEditResourceEdit

The resourceEdit feature

resourceRecordResourceModel

The record about to be shown in the editor.

Fires before the resource editor removes a resource.

// Adding a listener using the "on" method
resourceEdit.on('resourceEditBeforeRemove', ({ source, resource }) => {

});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

Fires before the resource editor saves changes to a resource.

// Adding a listener using the "on" method
resourceEdit.on('resourceEditBeforeSave', ({ source, resource }) => {

});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

Fires after the resource editor removes a resource.

// Adding a listener using the "on" method
resourceEdit.on('resourceEditRemove', ({ source, resource }) => {

});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

Fires after the resource editor saves changes to a resource.

// Adding a listener using the "on" method
resourceEdit.on('resourceEditSave', ({ source, resource, values }) => {

});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

valuesObject<string, any>

The changes

catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

10

Called on the owning grid before a resource editing starts. This may be listened for to allow an application to take over event editing duties. Returning false stops the default editing UI from being shown.

new ResourceEdit({
    onBeforeResourceEdit({ source, resourceEdit, resourceRecord }) {

    }
});
ParameterTypeDescription
sourceResourceGrid

The grid instance

resourceEditResourceEdit

The resourceEdit feature

resourceRecordResourceModel

The record about to be shown in the editor.

Called before the resource editor removes a resource.

new ResourceEdit({
    onResourceEditBeforeRemove({ source, resource }) {

    }
});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

Called before the resource editor saves changes to a resource.

new ResourceEdit({
    onResourceEditBeforeSave({ source, resource }) {

    }
});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

Called after the resource editor removes a resource.

new ResourceEdit({
    onResourceEditRemove({ source, resource }) {

    }
});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

Called after the resource editor saves changes to a resource.

new ResourceEdit({
    onResourceEditSave({ source, resource, values }) {

    }
});
ParameterTypeDescription
sourceResourceEditor

The editor widget

resourceResourceModel

The resource

valuesObject<string, any>

The changes

onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

1