Class idx.grid.PropertyEditAdaptor

Mixin for allowing the idx.grid.PropertyFormatter to use any widget as an "editor". This provides the "editor" interface to the widget.
Defined in: <idx\grid\PropertyEditAdaptor.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 

Field Summary

Field Attributes Field Name and Description
 
The name of the editor function which fires when
 
The name of the attribute used to determine if the editor is checkable or the name of the function for getting & setting the checked state of the editor.
<static>  
idx.grid.PropertyEditAdaptor.DEFAULT 
The PropertyEditAdaptor used for the "propertyEditAdaptor" attribute of all widgets by default.
 
The name of the attribute to set to true or false to indicate if the editor should be marked as "disabled".
 
editor 
Indicates whether or not the widget should be used as an editor.
<static>  
idx.grid.PropertyEditAdaptor.EXCLUDED 
The PropertyEditAdaptor used for the "propertyEditAdaptor" attribute of widgets that should NOT be considered as editors.
 
The explicit property name to be assigned to all editors that leverage this adaptor.
 
The name of the attribute used for extracting the property name assigned to the editor.
 
The name of the attribute to set to true or false to indicate if the editor should be marked as "read only".
 
The name of the reset function to search for in the editor.
 
The name of the resize function to search for in the editor.
<static>  
idx.grid.PropertyEditAdaptor.STANDARD 
The PropertyEditAdaptor that can be used for the "propertyEditAdaptor" attribute of widgets that have the same interface as dijit.form._FormWidgetMixin descendants, but are NOT descendants of dijit.form._FormWidgetMixin.
<static>  
idx.grid.PropertyEditAdaptor.UNCHECKABLE 
The PropertyEditAdaptor used for the "propertyEditAdaptor" attribute of widgets that have the dijit.form._FormWidgetMixin interface and may have the "checked" attribute but should be leveraged as if they do not have the "checked" attribute (thus causing their values to be treated literally rather than as true/false values depending on the "checked" state of the editor).
 
The name of the validation function to search for in the editor.
 
The name of the attribute or function to use to check if the editor's value is valid.
 
The name of the attribute on the editor widget to set with the value and retrieve when editing or saving values.

Method Summary

Method Attributes Method Name and Description
 
Constructor that accepts the specified arguments and initializes the adapter.
 
Checks if the specified editor has a function by the same name as the "changeEvent" attribute of this instance and if so, returns the name of the function, otherwise returns null.
 
Gets the current value from the editor using the valueAttr.
 
Returns the name to associate with the editor.
 
isEditor(widget)
Checks if the specified widget should be used as an editor.
 
Checks if the editor is "checkable".
 
Checks if the editor is in a "checked" state.
 
Checks if the editor is in a disabled state.
 
Checks if the editor is in a read-only state.
 
Checks if reset can be performed for the specified editor widget.
 
Checks if resize can be performed for the specified editor widget.
 
isEditorValid(editor)
Checks if the value for the specified widget is currently in a valid state.
 
Checks if validation should be performed for the specified editor widget.
 
resetEditor(editor)
Resets the specified editor widget if reset is supported, otherwise does nothing.
 
resizeEditor(editor)
Resize the specified editor widget if resize is supported, otherwise does nothing.
 
setEditorChecked(editor, checked)
Sets the "checked" state of the editor if such a state is supported by the editor, otherwise does nothing.
 
setEditorDisabled(editor, disabled)
Sets the "disabled" state of the editor if such a state is supported by the editor, otherwise does nothing.
 
setEditorReadOnly(editor, readOnly)
Sets the "read-only" state of the editor if such a state is supported by the editor, otherwise does nothing.
 
setEditorValue(editor, value)
Sets the value for the editor to the specified value using the valueAttr.
 
Validates the value for the specified editor widget if validation is supported, otherwise does nothing.

Constructor Detail

idx.grid.PropertyEditAdaptor()

Field Detail

changeEvent

The name of the editor function which fires when

checkedAttr

The name of the attribute used to determine if the editor is checkable or the name of the function for getting & setting the checked state of the editor. This is used for widgets that represent boolean values and represent this by being checked or unchecked.
Default Value:
"checked"

<static> idx.grid.PropertyEditAdaptor.DEFAULT

The PropertyEditAdaptor used for the "propertyEditAdaptor" attribute of all widgets by default. The default adaptor will work such that all descendants of dijit.form._FormWidgetMixin will be considered editors by default with the default settings for PropertyEditAdaptor.

disabledAttr

The name of the attribute to set to true or false to indicate if the editor should be marked as "disabled". If this is set to a function then that function will be called with a parameter of true or false for disabled or enabled, respectively. When checking for disabled state the attribute is retrieved via the "get" function unless the attribute name represents a function for the editor, in which case it is called with no parameters.
Default Value:
"disabled"

editor

Indicates whether or not the widget should be used as an editor. The value defaults to null in the constructor if not specified. A null value indicates that it will automatically be determined as true for descendants of dijit.form._FormWidgetMixin and false for non-descendants. A value of true means that the widget will always be considered an editor regardless of lineage of a value of false indicates that the widget will never be considered as an editor regardless of lineage.
Default Value:
null

<static> idx.grid.PropertyEditAdaptor.EXCLUDED

The PropertyEditAdaptor used for the "propertyEditAdaptor" attribute of widgets that should NOT be considered as editors. This is useful if your dijit.form._FormWidgetMixin descendant should NOT be used as an editor by idx.grid.PropertyFormatter. Alternatively, you can set the "propertyEditAdaptor" attribute on your widget to null.

propertyName

The explicit property name to be assigned to all editors that leverage this adaptor. This defaults to empty-string which means it will be ignored and therefore the "propertyNameAttr" will be used to obtain the property name from the editor widget.
Default Value:
""

propertyNameAttr

The name of the attribute used for extracting the property name assigned to the editor. This defaults to "name" which works with descendants of dijit.form._FormWidgetMixin. If the value obtained from this attribute is non-empty and non-null it is assumed to be the property name to be assigned to the editor. If the editor does not have an attribute that identifies its name and an explicit name is needed then set the "propName" attribute to a non-null, non-empty value to cause the attribute to be ignored. If this value specifies the name of a function on the editor, then that function will be called to obtain the name.
Default Value:
"name"

readOnlyAttr

The name of the attribute to set to true or false to indicate if the editor should be marked as "read only". If this is set to a function then that function will be called with a parameter of true or false for read-only or not read-only, respectively. When checking for read-only state the attribute is retrieved via the "get" function unless the attribute name represents a function for the editor, in which case it is called with no parameters.
Default Value:
"readOnly"

resetFunc

The name of the reset function to search for in the editor. If it has the function then a reset can be performed.
Default Value:
"reset"

resizeFunc

The name of the resize function to search for in the editor. If it has the function then a resize can be performed.
Default Value:
""

<static> idx.grid.PropertyEditAdaptor.STANDARD

The PropertyEditAdaptor that can be used for the "propertyEditAdaptor" attribute of widgets that have the same interface as dijit.form._FormWidgetMixin descendants, but are NOT descendants of dijit.form._FormWidgetMixin. This is useful if your widget has the same properties as a form widget for getting name, value, checked, readOnly, and disabled attributes but is not a form widget.

<static> idx.grid.PropertyEditAdaptor.UNCHECKABLE

The PropertyEditAdaptor used for the "propertyEditAdaptor" attribute of widgets that have the dijit.form._FormWidgetMixin interface and may have the "checked" attribute but should be leveraged as if they do not have the "checked" attribute (thus causing their values to be treated literally rather than as true/false values depending on the "checked" state of the editor). This instance is otherwise identical to the "STANDARD" instance.

validateFunc

The name of the validation function to search for in the editor. If it has the function then validation can be performed.
Default Value:
"validate"

validCheck

The name of the attribute or function to use to check if the editor's value is valid. If it is an attribute then the value is retrieved and assumed to be true or false. If it is a function, then the function is called and the value is returned.
Default Value:
"isValid"

valueAttr

The name of the attribute on the editor widget to set with the value and retrieve when editing or saving values. NOTE: source property names are translated to target property names when editing initiates and target names back to source names when editing concludes.
Default Value:
"value"

Method Detail

constructor(args)

Constructor that accepts the specified arguments and initializes the adapter.
Parameters:
args
The parameters for initialization.

getEditorChangeEvent(editor)

Checks if the specified editor has a function by the same name as the "changeEvent" attribute of this instance and if so, returns the name of the function, otherwise returns null. If the "changeEvent" attribute is empty or null, then this method returns null.
Parameters:
editor
The widget editor to check for a change event.
Returns:
The name of the function that is called upon changes to the editor.

getEditorValue(editor)

Gets the current value from the editor using the valueAttr.
Parameters:
editor
The editor from which to obtain the value.

getPropertyName(editor)

Returns the name to associate with the editor. This maps to the property name to use to map to the value of the editor by default (barring any additional properties that may be required via the "properties" attr).
Parameters:
editor
The editor widget for which the editor name is being requested.
Returns:
The editor name to associate with the editor.

isEditor(widget)

Checks if the specified widget should be used as an editor.
Parameters:
widget
The widget to check to see if it is an editor.
Returns:
true if the widget should be considered an editor, otherwise false.

isEditorCheckable(editor)

Checks if the editor is "checkable".
Parameters:
editor
The editor widget to check.
Returns:
true to indicate that the checked attribute is set and found in the editor, otherwise false.

isEditorChecked(editor)

Checks if the editor is in a "checked" state. If the editor does not support "checked" state then this method returns null or undefined.
Parameters:
editor
The editor widget to check.
Returns:
true, false or null/undefined depending on whether the editor is in checked, unchecked, or unknown state.

isEditorDisabled(editor)

Checks if the editor is in a disabled state. If the editor does not support disabled state then this method returns null or undefined.
Parameters:
editor
The editor widget to check.
Returns:
true, false or null/undefined depending on whether the editor is in a disabled, enabled or unknown state.

isEditorReadOnly(editor)

Checks if the editor is in a read-only state. If the editor does not support read-only state then this method returns null or undefined.
Parameters:
editor
The editor widget to check.
Returns:
true, false or null/undefined depending on whether the editor is in read-only, writable, or unknown state.

isEditorResetable(editor)

Checks if reset can be performed for the specified editor widget.
Parameters:
editor
The editor widget to check for reset support.
Returns:
true if the specified widget supports reset, otherwise false.

isEditorResizable(editor)

Checks if resize can be performed for the specified editor widget.
Parameters:
editor
The editor widget to check for resize support.
Returns:
true if the specified widget supports resize, otherwise false.

isEditorValid(editor)

Checks if the value for the specified widget is currently in a valid state.
Parameters:
editor
The editor widget to check for a valid value.

isEditorValidating(editor)

Checks if validation should be performed for the specified editor widget.
Parameters:
editor
The editor widget to check for validation support.
Returns:
true if the specified widget supports validation, otherwise false.

resetEditor(editor)

Resets the specified editor widget if reset is supported, otherwise does nothing.
Parameters:
editor
The editor widget to be reset.

resizeEditor(editor)

Resize the specified editor widget if resize is supported, otherwise does nothing.
Parameters:
editor
The editor widget to be resize.

setEditorChecked(editor, checked)

Sets the "checked" state of the editor if such a state is supported by the editor, otherwise does nothing.
Parameters:
editor
The editor for which the "checked" state will be set.
checked
true or false to indicate whether or not the editor should marked as checked.

setEditorDisabled(editor, disabled)

Sets the "disabled" state of the editor if such a state is supported by the editor, otherwise does nothing.
Parameters:
editor
The editor for which the disabled state will be set.
disabled
true or false to indicate whether or not the editor should marked as disabled.

setEditorReadOnly(editor, readOnly)

Sets the "read-only" state of the editor if such a state is supported by the editor, otherwise does nothing.
Parameters:
editor
The editor for which the read only state will be set.
readOnly
true or false to indicate whether or not the editor should marked as read-only.

setEditorValue(editor, value)

Sets the value for the editor to the specified value using the valueAttr.
Parameters:
editor
The editor to have its value set.
value
The value to set for the editor.

validateEditor(editor)

Validates the value for the specified editor widget if validation is supported, otherwise does nothing.
Parameters:
editor
The editor widget whose value needs to be validated.