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
Configs
10Other
A configuration object applied to the internal ResourceEditor.
Misc
Properties
18
Properties
18Common
Class hierarchy
Other
Returns the editor widget representing this feature
Returns true if the editor is currently active
The current ResourceModel record, which is being edited by the editor.
Functions
29
Functions
29Other
Opens an editor for the passed resource. This function is exposed on grid and can be called as
grid.editResource().
| Parameter | Type | Description |
|---|---|---|
resourceRecord | ResourceModel | Resource to edit |
Configuration
Events
Misc
Events
10
Events
10Fires 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | ResourceGrid | The grid instance |
resourceEdit | ResourceEdit | The resourceEdit feature |
resourceRecord | ResourceModel | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
Fires before the resource editor saves changes to a resource.
// Adding a listener using the "on" method
resourceEdit.on('resourceEditBeforeSave', ({ source, resource }) => {
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
Fires after the resource editor removes a resource.
// Adding a listener using the "on" method
resourceEdit.on('resourceEditRemove', ({ source, resource }) => {
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
values | Object<string, any> | The changes |
Event handlers
10
Event handlers
10Called 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | ResourceGrid | The grid instance |
resourceEdit | ResourceEdit | The resourceEdit feature |
resourceRecord | ResourceModel | The record about to be shown in the editor. |
Called before the resource editor removes a resource.
new ResourceEdit({
onResourceEditBeforeRemove({ source, resource }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
Called before the resource editor saves changes to a resource.
new ResourceEdit({
onResourceEditBeforeSave({ source, resource }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
Called after the resource editor removes a resource.
new ResourceEdit({
onResourceEditRemove({ source, resource }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
Called after the resource editor saves changes to a resource.
new ResourceEdit({
onResourceEditSave({ source, resource, values }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | ResourceEditor | The editor widget |
resource | ResourceModel | The resource |
values | Object<string, any> | The changes |