Class idx.widget.EditController
Extends
dijit._TemplatedMixin, dijit._Widget.
Provides a button/link to trigger "edit" feature which then switches to multiple buttons
for "save" and "cancel" of editing along with appropriate events. This is typically used
with inline editing.
Defined in: <idx\widget\EditController.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
The label to use for the cancel button if editing.
|
|
Flag indicating if the controller is in disabled mode.
|
|
The ID of the node controlled by this controller when in edit mode.
|
|
The label to use for the save button if editting.
|
|
The ID of the node controlled by this controller when in read mode.
|
|
Flag indicating if the controller is in read-only mode.
|
|
The label to use for the save button if editing.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
Overridden to lookup default resources.
|
|
constructor(args, node)
Constructor
Handles the reading any attributes passed via markup.
|
|
destroy()
Handles destroying handles from linked editors.
|
|
linkEditor(widget, options)
Links the specified editor widget this with this widget.
|
|
onCancel()
This function exists so you can attach to it to
be notified whenever the cancel button has been clicked.
|
|
onEdit()
This function exists so you can attach to it to
be notified whenever the edit link has been clicked.
|
|
This function exists so you can attach to it to
be notified after the "onSave()" function has returned
and completed.
|
|
This function exists so you can attach to it to
be notified before the "onSave()" function has been
called.
|
|
onResize()
This function is called whenever the widget resizes itself.
|
|
onSave()
This function exists so you can attach to it to
be notified whenever the save button has been clicked.
|
|
postCreate - extended to create dojo handles to internal buttons
|
|
startup()
Called at startup to init contained buttons
|
|
unlinkEditor(widget)
Unlinks the specified widget (or widget identified by the specified ID) from this edit controller.
|
Constructor Detail
idx.widget.EditController()
Example usage: <div id="idxTestEditController2" dojoType="idx.widget.EditController" region="titleActions"></div> <div dojoType="idx.grid.PropertyGrid" data="{givenName: 'Joe', surname: 'Schmoe', age: 31, birthDate: new Date(1980,0,1)}" properties="givenName,surname,age(int),birthDate(dat)" editController="dijit.byId('idxTestEditController2')">
Field Detail
{String} cancelLabel
The label to use for the cancel button if editing. If not specified then
the default is taken from idx.resources using the "cancelLabel" key and the
"idx.widget.EditController" scope.
- Default Value:
- ""
{boolean} disabled
Flag indicating if the controller is in disabled mode.
- Default Value:
- false
editControlledNodeIDs
The ID of the node controlled by this controller when in edit mode.
{String} editLabel
The label to use for the save button if editting. If not specified then
the default is taken from idx.resources using the "editLabel" key and the
"idx.widget.EditController" scope.
- Default Value:
- ""
readControlledNodeIDs
The ID of the node controlled by this controller when in read mode.
{boolean} readOnly
Flag indicating if the controller is in read-only mode.
- Default Value:
- false
{String} saveLabel
The label to use for the save button if editing. If not specified then
the default is taken from idx.resources using the "saveLabel" key and the
"idx.widget.EditController" scope.
- Default Value:
- ""
Method Detail
buildRendering()
Overridden to lookup default resources.
constructor(args, node)
Constructor
Handles the reading any attributes passed via markup.
- Parameters:
- {Object} args
- {Object} node
destroy()
Handles destroying handles from linked editors.
linkEditor(widget, options)
Links the specified editor widget this with this widget.
- Parameters:
- widget
- The editor to link with this widget.
- options
- The options parameter optionally contains one or more of the following: - changeEvent: The name of the function to attach to when changes occur in the editor. - validCheck: The function, function name or attribute name to check to see if the editor's value is valid, if none then always assumed valid - onEdit: What to do when entering "edit mode". Either a function to call, a function name for a function to call on the editor, or object containing "attribute" and "value" fields indicating an attribute of the editor to be set to the specified value upon editing. - onPreSave: What to do after save is click, but before the "onSave" fires. Either a function to call, a function name for a function to call on the editor, or object containing "attribute" and "value" fields indicating an attribute of the editor to be set to the specified value upon pre-save. - onSave: What to do when entering saved. Either a function to call, a function name for a function to call on the editor, or object containing "attribute" and "value" fields indicating an attribute of the editor to be set to the specified value upon save. - onPostSave: What to do after save is click, and after the "onSave" fires. Either a function to call, a function name for a function to call on the editor, or object containing "attribute" and "value" fields indicating an attribute of the editor to be set to the specified value upon post-save. - onCancel: What to do when cancelling edit. Either a function to call, a function name for a function to call on the editor, or object containing "attribute" and "value" fields indicating an attribute of the editor to be set to the specified value upon cancel. - readNodeIDs: For accessibility, the comma-separated string list of node IDs indicating which nodes are "aria-controls" by this widget's "edit" link. - editNodeIDs: For accessibility, the comma-separated string list of node IDs indicating which nodes are "aria-controls" by this widget's "save" and "cancel" buttons.
onCancel()
This function exists so you can attach to it to
be notified whenever the cancel button has been clicked.
onEdit()
This function exists so you can attach to it to
be notified whenever the edit link has been clicked.
onPostSave()
This function exists so you can attach to it to
be notified after the "onSave()" function has returned
and completed. This should occur AFTER all those
attached to the "onSave()" function have been notified
of the "save button" click and therefore after all saving
has been completed.
onPreSave()
This function exists so you can attach to it to
be notified before the "onSave()" function has been
called. This should occur BEFORE all those
attached to the "onSave()" function have been notified
of the "save button" click and therefore before any saving
has occurred.
onResize()
This function is called whenever the widget resizes itself.
onSave()
This function exists so you can attach to it to
be notified whenever the save button has been clicked.
postCreate()
postCreate - extended to create dojo handles to internal buttons
startup()
Called at startup to init contained buttons
unlinkEditor(widget)
Unlinks the specified widget (or widget identified by the specified ID) from this edit controller.
- Parameters:
- widget
- The widget or String ID of the widget to be unlinked.