Class idx.grid.PropertyGrid
Extends
dijit._TemplatedMixin, dijit._Widget.
Provides a two-column grid display of name/value object properties. The class
provides for simple property formatting as well as complex formatting via
idx.grid.PropertyFormatter. A display property may be made up of one or more
actual data properties. Inline editing is also supported at the individual
property level (via PropertyFormatter) or at the grid level (allowing for a
single "Edit" button to control editing).
Internal widget class used by idx.grid.PropertyGrid to manage its rows.
Defined in: <idx\grid\PropertyGrid.js>.
Constructor Summary
Constructor Attributes | Constructor Name and Description |
---|---|
Field Summary
Field Attributes | Field Name and Description |
---|---|
The data object for this instance.
|
|
A reference to or the string ID of the idx.widget.EditController to be used
for this instance.
|
|
Overrides the "format" attribute by providing a function to call to
format the data object directly.
|
|
The prefix to attach to the property names when looking up the label
for that field in the resources.
|
|
The suffix to attach to the property names when looking up the label
for that field in the resources.
|
|
A comma separated list of property names from the data object to be
formatted by this instance.
|
|
Indicates whether or not the property grid should use the property
names directly as labels rather than trying to lookup them in
resources or format them nicely.
|
|
The resources to use for obtaining the labels for each of the properties.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
addChild(child, index)
Extends parent method by setting up child
widgets and rebuilding rows.
|
|
constructor(args, node)
Constructor
Handles the reading any attributes passed via markup.
|
|
destroy()
Cleans up the widgets in the hidden node.
|
|
onChange(data, grid, formatter)
Called whenever the fields of the existing data object are modified,
but not when the data object itself is changed.
|
|
onEditControllerChanged(controller)
Called whenever the edit controller changed
|
|
Overrides dijit._Widget.postMixInProperties() to ensure
that the resources are reset.
|
|
refresh()
Exposes reformat method for public access.
|
|
removeChild(child, index)
Extends parent method by setting up child
widgets and rebuilding rows.
|
|
startup()
Called at startup to set state, setup children
and rebuild rows.
|
Field Detail
{Object} data
The data object for this instance.
- Default Value:
- null
{Object} editController
A reference to or the string ID of the idx.widget.EditController to be used
for this instance. If none is specified the the contained PropertyFormatter
instance may create their own EditController to accomodate contained editors.
See idx.widget.EditController.
- Default Value:
- null
{String} formatFunc
Overrides the "format" attribute by providing a function to call to
format the data object directly. The property name and the data object
itself are passed as parameters to this function and it is expected to
return a string. If this function returns null, then the default formatting
for the property is used.
- Default Value:
- null
{String} labelKeyPrefix
The prefix to attach to the property names when looking up the label
for that field in the resources. If not specified the value is taken
from the resources using the "labelKeyPrefix" key. The default value
is empty string.
- Default Value:
- ""
{String} labelKeySuffix
The suffix to attach to the property names when looking up the label
for that field in the resources. If not specified the value is taken
from the resources using the "labelKeyPrefix" key. The default value
is empty string.
- Default Value:
- ""
{String} properties
A comma separated list of property names from the data object to be
formatted by this instance. This can be a single property name, a
simple list of property names, or a property name with type name in
parentheses following it.
For example: EXAMPLE 1 (single property name): "givenName" EXAMPLE 2 (list of property names): "givenName,surname,age,birthDate" EXAMPLE 3 (property with type): "startTime(time)" EXAMPLE 4 (assorted list): "givenName,surname,age(int),birthDate(date)" The legal format types are: - txt: assumes literal text (default for string properties) - dat: uses date formatting (default for date properties) - tim: uses time formatting - dtm: uses date-time formatting - dec: uses decimal formatting (default for numeric properties) - int: uses integer formatting - pct: uses percentage formatting - cur: uses currency formatting
- Default Value:
- ""
{Boolean} rawLabels
Indicates whether or not the property grid should use the property
names directly as labels rather than trying to lookup them in
resources or format them nicely.
- Default Value:
- false
{String} resources
The resources to use for obtaining the labels for each of the properties.
The resources that are used by this include:
- labelKeyPrefix: the default prefix for the key used to lookup labels
- labelKeySuffix: the default suffix for the key used to lookup labels
- emptyFormat: for formatting empty values
- dateFormatOptions: for formatting "dat" properties
- timeFormatOptions: for formatting "tim" properties
- dateTimeFormatOptions: for formatting "dtm" properties
- decimalFormatOptions: for formatting "dec" properties
- integerFormatOptions: for formatting "int" properties
- percentFormatOptions: for formatting "pct" properties
- currencyFormatOptions: for formatting "cur" properties
- labelFieldSeparator: for separating labels from their fields
- Default Value:
- null
Method Detail
addChild(child, index)
Extends parent method by setting up child
widgets and rebuilding rows.
- Parameters:
- {Object} child
- {int} index
- See:
- dijit._Container.addChild
buildRendering()
- See:
- dijit._Container.buildRendering
constructor(args, node)
Constructor
Handles the reading any attributes passed via markup.
- Parameters:
- {Object} args
- {Object} node
destroy()
Cleans up the widgets in the hidden node.
onChange(data, grid, formatter)
Called whenever the fields of the existing data object are modified,
but not when the data object itself is changed. That is to say that
set("data", someValue) will not trigger this method. If multiple
fields are changed with a single click of the "save" button from the
PropertyGrid's EditController, then this method is designed to be called
only once for the change to avoid multiple round trips to the server.
- Parameters:
- {Object} data
- The data that was changed.
- {PropertyGrid} grid
- The property grid that fired the event.
- {PropertyFormatter} formatter
- The property formatter that triggered the event.
onEditControllerChanged(controller)
Called whenever the edit controller changed
- Parameters:
- {Object} controller
postCreate()
- See:
- dijit._Container.postCreate
postMixInProperties()
Overrides dijit._Widget.postMixInProperties() to ensure
that the resources are reset.
- See:
- dijit._Widget.postMixInProperties
refresh()
Exposes reformat method for public access. Call this method
when the underlying data values have changed for the referenced
data object in order to notify the PropertyGrid to reformat its
displayed values with the new values.
This method need not be called when changing the resources or
the properties or the label prefix or suffix as these methods
will automatically trigger the appropriate refresh. This method
exists solely for when the data object referenced is shred by
multiple objects and one object has changed the values, but this
PropertyGrid may be unaware of that change.
removeChild(child, index)
Extends parent method by setting up child
widgets and rebuilding rows.
- Parameters:
- {Object} child
- {int} index
- See:
- dijit._Container.addChild
startup()
Called at startup to set state, setup children
and rebuild rows.
- See:
- dijit._Container.startup