A grid that supports nesting rows - it provides an expando function similar to dijit.Tree. It also provides mechanisms for aggregating the values of subrows
TreeGrid currently only works on "simple" structures. That is, single-view structures with a single row in them.
The TreeGrid works using the concept of "levels" - level 0 are the top-level items.
Parameter | Type | Description |
---|---|---|
params | Object | null | Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties. |
srcNodeRef | DOMNode | String |
Optional If a srcNodeRef (DOM node) is specified:
|
See the dojox/grid/TreeGrid reference documentation for more information.
List of connections associated with data-dojo-attach-event=... in the template
List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
Path to a blank 1x1 image.
Used by <img>
nodes in templates that really get their image via CSS background-image.
Not normally use, but this flag can be set by the app if the server has already rendered the template, i.e. already inlining the template for the widget into the main page. Reduces _TemplatedMixin to just function like _AttachMixin.
The aggregator class - it will be populated automatically if we are a collapsible grid
Object to which attach points and events will be scoped. Defaults to 'this'.
Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute for each XXX attribute to be mapped to the DOM.
attributeMap sets up a "binding" between attributes (aka properties) of the widget and the widget's DOM. Changes to widget attributes listed in attributeMap will be reflected into the DOM.
For example, calling set('title', 'hello') on a TitlePane will automatically cause the TitlePane's DOM to update with the new title.
attributeMap is a hash where the key is an attribute of the widget, and the value reflects a binding to a:
DOM node attribute
focus: {node: "focusNode", type: "attribute"} Maps this.focus to this.focusNode.focus
DOM node innerHTML
title: { node: "titleNode", type: "innerHTML" } Maps this.title to this.titleNode.innerHTML
DOM node innerText
title: { node: "titleNode", type: "innerText" } Maps this.title to this.titleNode.innerText
DOM node CSS class
myClass: { node: "domNode", type: "class" } Maps this.myClass to this.domNode.className
If the value is an array, then each element in the array matches one of the formats of the above list.
There are also some shorthands for backwards compatibility:
"focusNode" ---> { node: "focusNode", type: "attribute" }
If autoHeight is true, grid height is automatically set to fit the data. If it is an integer, the height will be automatically set to fit the data if there are fewer than that many rows - and the height will be set to show that many rows if there are more
If autoRender is true, grid will render itself after initialization.
If autoWidth is true, grid width is automatically set to fit the data.
Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate widget state.
css class to apply to grid cells over which the cursor is placed.
If set to true, will add drag and drop reordering to views with one row of columns.
Designates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets. For example, for myWidget:
<div data-dojo-type=myWidget> <b> here's a plain DOM node <span data-dojo-type=subWidget>and a widget</span> <i> and another plain DOM node </i> </div>
containerNode would point to:
<b> here's a plain DOM node <span data-dojo-type=subWidget>and a widget</span> <i> and another plain DOM node </i>
In templated widgets, "containerNode" is set via a data-dojo-attach-point assignment.
containerNode must be defined for any widget that accepts innerHTML (like ContentPane or BorderContainer or even Button), and conversely is null for widgets that don't, like TextBox.
default height of the grid, measured in any valid css unit.
Whether or not we default to open (all levels). This defaults to false for grids with a treeModel.
Bi-directional support, as defined by the HTML DIR attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's default direction.
This is our visible representation of the widget! Other DOM Nodes may by assigned to other properties, usually through the template system's data-dojo-attach-point syntax, but the domNode property is the canonical "top level" node in widget UI.
indicates if the grid contains editable cells, default is false set to true if editable cell encountered during rendering
Override defaults and make the indexed grid view elastic, thus filling available horizontal space.
Message that shows when the grid encounters an error loading
This will escape HTML brackets from the data to prevent HTML from user-inputted data being rendered with may contain JavaScript and result in XSS attacks. This is true by default, and it is recommended that it remain true. Setting this to false will allow data to be displayed in the grid without filtering, and should be only used if it is known that the data won't contain malicious scripts. If HTML is needed in grid cells, it is recommended that you use the formatter function to generate the HTML (the output of formatter functions is not filtered, even with escapeHTMLInData set to true).
When used in conjunction with a treeModel (see above), this is a 0-based index of the cell in which to place the actual expando
flag modifies vertical scrolling behavior. Defaults to true but set to false for slower scroll performance but more immediate scrolling feedback
This widget or a widget it contains has focus, or is "active" because it was recently clicked.
An object to execute format functions within. If not set, the format functions will execute within the scope of the cell that has a format function.
If set to a dijit.Menu, will use this as a context menu for the grid headers.
explicit height of the grid, measured in any valid css unit. This will be populated (and overridden) if the height: css attribute exists on the source node.
A unique, opaque ID string that can be assigned by users or by the system. If the developer passes an ID which is known not to be unique, the specified ID is ignored and the system-generated ID is used instead.
A css string to use to set our initial width (only used if autoWidth is true). The first rendering of the grid will be this width, any resizing of columns, etc will result in the grid switching to autoWidth mode. Note, this width will override any styling in a stylesheet or directly on the node.
Message that shows if the grid has no data - wrap it in a span with class 'dojoxGridNoData' if you want it to be styled similar to the loading and error messages
Which levels we are open at (overrides defaultOpen for the values that exist here). Its values can be a boolean (true/false) or an integer (for the # of children to be closed if there are more than that)
The document this widget belongs to. If not specified to constructor, will default to srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global
Label of placeholders to search for in the header menu to replace with column toggling menu items.
If rowHeight is set to a positive number, it will define the height of the rows in pixels. This can provide a significant performance advantage, since it eliminates the need to measure row sizes during rendering, which is one the primary bottlenecks in the DataGrid's performance.
If set to true, will add a row selector view to this grid. If set to a CSS width, will add a row selector of that width to this grid.
pixel distance a user must scroll vertically to trigger grid scrolling.
Set to true if you want to be able to select the text within the grid.
Set the selection mode of grid's Selection. Value must be 'single', 'multiple', or 'extended'. Default is 'extended'.
If true, child items will be returned sorted according to the sorting properties of the grid.
Customizable summary descriptions which will be added to grid.domNode
Path to template (HTML file) for this widget relative to dojo.baseUrl. Deprecated: use templateString with require([... "dojo/text!..."], ...) instead
HTML title attribute.
For form widgets this specifies a tooltip to display when hovering over the widget (just like the native HTML title attribute).
For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer, etc., it's used to specify the tab label, accordion pane title, etc. In this case it's interpreted as HTML.
When this widget's title attribute is used to for a tab label, accordion pane title, etc., this specifies the tooltip to appear when the mouse is hovered over that text.
A dijit.Tree model that will be used instead of using aggregates. Setting this value will make the TreeGrid behave like a columnar tree. When setting this value, defaultOpen will default to false, and openAtLevels will be ignored.
Time, in milliseconds, to delay updates automatically so that multiple calls to onSet/onNew/onDelete don't keep rerendering the grid. Set to 0 to immediately cause updates. A higher value will result in better performance at the expense of responsiveness of the grid.
Parameter | Type | Description |
---|---|---|
item | undefined | |
index | undefined | |
noUpdate | undefined | |
dontUpdateRoot | undefined |
Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.
Skips over blank/false attribute values, unless they were explicitly specified as parameters to the widget, since those are the default anyway, and setting tabIndex="" is different than not setting tabIndex at all.
For backwards-compatibility reasons attributeMap overrides _setXXXAttr when _setXXXAttr is a hash/string/array, but _setXXXAttr as a functions override attributeMap.
Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.
Parameter | Type | Description |
---|---|---|
node | DOMNode | The node to setup a listener on. |
type | String | Event name like "click". |
func | undefined |
Iterate through the dom nodes and attach functions and nodes accordingly.
Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:
Parameter | Type | Description |
---|---|---|
rootNode | DomNode | The node to search for properties. All descendants will be searched. |
Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter. If commands isn't specified then it's looked up from attributeMap. Note some attributes like "type" cannot be processed this way as they are not mutable.
Parameter | Type | Description |
---|---|---|
attr | String | Name of member variable (ex: "focusNode" maps to this.focusNode) pointing to DOMNode inside the widget, or alternately pointing to a subwidget |
value | String | |
commands | Object |
Optional
|
Internal helper for directly changing an attribute value.
Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.
Parameter | Type | Description |
---|---|---|
name | String | The property to set. |
value | Mixed | The value to set in the property. |
Internal helper for directly changing an attribute value.
Parameter | Type | Description |
---|---|---|
a | undefined | |
b | undefined | |
attribute | undefined | |
descending | undefined |
Parameter | Type | Description |
---|---|---|
index | undefined | |
identity | undefined | |
item | undefined |
Parameter | Type | Description |
---|---|---|
idx | undefined | |
attr | undefined |
Parameter | Type | Description |
---|---|---|
item | undefined | |
index | undefined |
Detach and clean up the attachments made in _attachtempalteNodes.
Parameter | Type | Description |
---|---|---|
m | undefined | |
e | undefined |
Escape a value to be inserted into the template, either into an attribute value (ex: foo="${bar}") or as inner text of an element (ex: ${foo})
Parameter | Type | Description |
---|---|---|
val | String |
Parameter | Type | Description |
---|---|---|
start | undefined | |
isRender | undefined |
Relocate source contents to templated container node. this.containerNode must be able to receive children, or exceptions will be thrown.
Parameter | Type | Description |
---|---|---|
source | DomNode |
Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters. Used mainly by custom getters.
For example, CheckBox._getValueAttr() calls this._get("value").
Parameter | Type | Description |
---|---|---|
name | String |
Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.
Parameter | Type | Description |
---|---|---|
name | undefined |
Parameter | Type | Description |
---|---|---|
idx | undefined | |
attr | undefined |
Parameter | Type | Description |
---|---|---|
item | undefined | |
isDeleted | undefined |
Collect metadata about this widget (only once per class, not once per instance):
- list of attributes with custom setters, storing in this.constructor._setterAttrs - generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
Parameter | Type | Description |
---|---|---|
inPageIndex | undefined |
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined |
Process data-dojo-attach-point and data-dojo-attach-event for given node or widget. Returns true if caller should process baseNode's children too.
Parameter | Type | Description |
---|---|---|
baseNode | DOMNode | Widget | |
getAttrFunc | Function | Function to get the specified property for a given DomNode/Widget. |
attachFunc | Function |
Optional Attaches an event handler from the specified node/widget to specified function. |
Parameter | Type | Description |
---|---|---|
inPageIndex | undefined |
Parameter | Type | Description |
---|---|---|
changeSize | undefined | |
resultSize | undefined |
Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.
Parameter | Type | Description |
---|---|---|
name | String | |
value | anything |
Parameter | Type | Description |
---|---|---|
ah | undefined | |
skipRender | undefined |
Parameter | Type | Description |
---|---|---|
query | undefined | |
queryOptions | undefined |
Parameter | Type | Description |
---|---|---|
structure | undefined |
Sets the style attribute of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string
Determines which node to set the style on based on style setting in attributeMap.
Parameter | Type | Description |
---|---|---|
value | String | Object |
Parameter | Type | Description |
---|---|---|
textDir | undefined |
Does substitution of ${foo} type properties in template string
Parameter | Type | Description |
---|---|---|
tmpl | undefined |
measures and normalizes header height, then sets view heights, and then updates scroller content extent
Parameter | Type | Description |
---|---|---|
inHeaderHeight | undefined |
sets width and position for views and update grid width if necessary
This method is deprecated, use get() or set() directly.
Parameter | Type | Description |
---|---|---|
name | String | Object | The property to get or set. If an object is passed here and not a string, its keys are used as names of attributes to be set and the value of the object as values to set in the widget. |
value | Object |
Optional Optional. If provided, attr() operates as a setter. If omitted, the current value of the named property is returned. |
Use to make multiple changes to rows while queueing row updating.
Parameter | Type | Description |
---|---|---|
inCell | undefined | |
inRowIndex | undefined |
Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy.
Provide widget-specific analog to dojo.connect, except with the
implicit use of this widget as the target object.
Events connected with this.connect
are disconnected upon
destruction.
Parameter | Type | Description |
---|---|---|
obj | Object | null | |
event | String | Function | |
method | String | Function |
A handle that can be passed to disconnect
in order to disconnect before
the widget is destroyed.
var btn = new Button(); // when foo.bar() is called, call the listener we're going to // provide in the scope of btn btn.connect(foo, "bar", function(){ console.debug(this.toString()); });
Kick off the life-cycle of a widget
Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate, etc.), some of which of you'll want to override. See http://dojotoolkit.org/reference-guide/dijit/_WidgetBase.html for a discussion of the widget creation lifecycle.
Of course, adventurous developers could override create entirely, but this should only be done as a last resort.
Parameter | Type | Description |
---|---|---|
params | Object | null | Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties. |
srcNodeRef | DOMNode | String |
Optional If a srcNodeRef (DOM node) is specified:
|
create grid managers for various tasks including rows, focus, selection, editing
Parameter | Type | Description |
---|---|---|
inClass | undefined | |
idx | undefined |
Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed. Returns an object handle with a remove method (that returns null) (replaces clearTimeout).
Parameter | Type | Description |
---|---|---|
fcn | Function | Function reference. |
delay | Number |
Optional Delay, defaults to 0. |
Recursively destroy the children of this widget and their descendants.
Parameter | Type | Description |
---|---|---|
preserveDom | Boolean |
Optional If true, the preserveDom attribute is passed to all descendant widget's .destroy() method. Not for use with _Templated widgets. |
Destroy this widget and its descendants
This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it is removed from the manager object.
Parameter | Type | Description |
---|---|---|
preserveDom | Boolean |
Optional If true, this method will leave the original DOM structure alone of descendant Widgets. Note: This will NOT work with dijit._TemplatedMixin widgets. |
Destroys the DOM nodes associated with this widget.
Parameter | Type | Description |
---|---|---|
preserveDom | Boolean |
Optional If true, this method will leave the original DOM structure alone during tear-down. Note: this will not work with _Templated widgets yet. |
Deprecated, will be removed in 2.0, use handle.remove() instead.
Disconnects handle created by connect
.
Parameter | Type | Description |
---|---|---|
handle | undefined |
Parameter | Type | Description |
---|---|---|
inValue | undefined | |
inRowIndex | undefined | |
inAttrName | undefined |
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined | |
inDataAttr | undefined |
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined |
Parameter | Type | Description |
---|---|---|
inCell | undefined | |
inRowIndex | undefined |
Used by widgets to signal that a synthetic event occurred, ex:
myWidget.emit("attrmodified-selectedChildWidget", {}).
Emits an event on this.domNode named type.toLowerCase(), based on eventObj. Also calls onType() method, if present, and returns value from that method. By default passes eventObj to callback, but will pass callbackArgs instead, if specified. Modifies eventObj by adding missing parameters (bubbles, cancelable, widget).
Parameter | Type | Description |
---|---|---|
type | String | |
eventObj | Object |
Optional
|
callbackArgs | Array |
Optional
|
Use after calling beginUpdate to render any changes made to rows.
Parameter | Type | Description |
---|---|---|
query | undefined | |
reRender | undefined |
Default data getter.
Provides data to display in a grid cell. Called in grid cell context. So this.cell.index is the column index.
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Row for which to provide data |
inItem | undefined |
Data to display for a given grid cell.
Retrieves the cell object for a given grid column.
Parameter | Type | Description |
---|---|---|
inIndex | Integer | Grid column index of cell to retrieve |
a grid cell
Parameter | Type | Description |
---|---|---|
inColIndex | undefined | |
inRowIndex | undefined |
Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget. Note that it does not return all descendants, but rather just direct children. Analogous to Node.childNodes, except containing widgets rather than DOMNodes.
The result intentionally excludes internally created widgets (a.k.a. supporting widgets) outside of this.containerNode.
Note that the array returned is a simple array. Application code should not assume existence of methods like forEach().
returns an array of dijit.CheckedMenuItem widgets that can be added to a menu for toggling columns on and off.
Returns the default open state for the given definition and item It reads from the openAtLevels and defaultOpen values of the grid to calculate if the given item should default to open or not.
Parameter | Type | Description |
---|---|---|
cellDef | undefined | |
item | undefined |
Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. This method should generally be avoided as it returns widgets declared in templates, which are supposed to be internal/hidden, but it's left here for back-compat reasons.
overridden so that you can pass in a '/' delimited string of indexes to get the item based off its path...that is, passing in "1/3/2" will get the 3rd (0-based) child from the 4th child of the 2nd top-level item.
Parameter | Type | Description |
---|---|---|
idx | integer | Array | String |
find the rowNode that is not a rowSelector
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined |
Returns true if grid is sorted in an ascending direction.
Parameter | Type | Description |
---|---|---|
inSortInfo | undefined |
Returns the index of the column on which the grid is sorted
Parameter | Type | Description |
---|---|---|
inSortInfo | undefined |
Return true if this widget can currently be focused and false if not
Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
Parameter | Type | Description |
---|---|---|
props | undefined | |
node | undefined | |
ctor | undefined | |
cellFunc | undefined |
Parameter | Type | Description |
---|---|---|
type | String | Function | protected |
func | Function |
Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
The array of specified handles, so you can do for example:
var handle = this.own(on(...))[0];
Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.
A convenience function provided in all _Widgets, providing a simple shorthand mechanism to put an existing (or newly created) Widget somewhere in the dom, and allow chaining.
Parameter | Type | Description |
---|---|---|
reference | String | DomNode | DocumentFragment | dijit/_WidgetBase | Widget, DOMNode, DocumentFragment, or id of widget or DOMNode |
position | String | Int |
Optional If reference is a widget (or id of widget), and that widget has an ".addChild" method, it will be called passing this widget instance into that method, supplying the optional position index passed. In this case position (if specified) should be an integer. If reference is a DOMNode (or id matching a DOMNode but not a widget), the position argument can be a numeric index or a string "first", "last", "before", or "after", same as dojo/dom-construct::place(). |
Provides a useful return of the newly created dijit._Widget instance so you can "chain" this function by instantiating, placing, then saving the return value to a variable.
// create a Button with no srcNodeRef, and place it in the body: var button = new Button({ label:"click" }).placeAt(win.body()); // now, 'button' is still the widget reference to the newly created button button.on("click", function(e){ console.log('click'); }));
// create a button out of a node with id="src" and append it to id="wrapper": var button = new Button({},"src").placeAt("wrapper");
// place a new button as the first element of some div var button = new Button({ label:"click" }).placeAt("wrapper","first");
// create a contentpane and add it to a TabContainer var tc = dijit.byId("myTabs"); new ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
Kicks off widget instantiation. See create() for details.
Parameter | Type | Description |
---|---|---|
params | Object |
Optional
|
srcNodeRef | DomNode | String |
Render the grid, headers, and views. Edit and scrolling states are reset. To retain edit and scrolling states, see Update.
used internally to render rows
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined | |
inNodes | undefined |
Update the grid's rendering dimensions and resize it
Parameter | Type | Description |
---|---|---|
changeSize | undefined | |
resultSize | undefined |
Update grid when the height of a row has changed. Row height is handled automatically as rows are rendered. Use this function only to update a row's height outside the normal rendering process.
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | index of the row that has changed height |
used internally to remove rows
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined |
Vertically scroll the grid to a given pixel position
Parameter | Type | Description |
---|---|---|
inTop | Integer | vertical position of the grid in pixels |
Scroll the grid to a specific row.
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | grid row index |
Set a property on a widget
Sets named properties on a widget which may potentially be handled by a setter in the widget.
For example, if the widget has properties foo
and bar
and a method named _setFooAttr()
, calling
myWidget.set("foo", "Howdy!")
would be equivalent to calling
widget._setFooAttr("Howdy!")
and myWidget.set("bar", 3)
would be equivalent to the statement widget.bar = 3;
set() may also be called with a hash of name/value pairs, ex:
myWidget.set({ foo: "Howdy", bar: 3 });
This is equivalent to calling set(foo, "Howdy")
and set(bar, 3)
Parameter | Type | Description |
---|---|---|
name | undefined | The property to set. |
value | undefined | The value to set in the property. |
Set a property on a widget
Deprecated. Use set() instead.
Parameter | Type | Description |
---|---|---|
attr | String | |
value | anything |
Parameter | Type | Description |
---|---|---|
inColIndex | undefined | |
inRowIndex | undefined | |
textDir | undefined |
Parameter | Type | Description |
---|---|---|
inIndex | undefined | |
inUnitWidth | undefined |
Parameter | Type | Description |
---|---|---|
query | undefined | |
queryOptions | undefined |
Sort the grid on a column in a specified direction
Parameter | Type | Description |
---|---|---|
inIndex | Integer | Column index on which to sort. |
inAsc | Boolean | If true, sort the grid in ascending order, otherwise in descending order |
Parameter | Type | Description |
---|---|---|
store | undefined | |
query | undefined | |
queryOptions | undefined |
Install a new structure and rebuild the grid.
Parameter | Type | Description |
---|---|---|
inStructure | dojox.grid.__ViewDef | dojox.grid.__ViewDef[] | dojox.grid.__CellDef[] | Array[dojox.grid.__CellDef[]] |
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined | |
inRowNode | undefined |
Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
Subscribes to the specified topic and calls the specified method of this object and registers for unsubscribe() on widget destroy.
Provide widget-specific analog to dojo.subscribe, except with the implicit use of this widget as the target object.
Parameter | Type | Description |
---|---|---|
t | String | The topic |
method | Function | The callback |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Returns a string that represents the widget.
When a widget is cast to a string, this method will be used to generate the output. Currently, it does not implement any sort of reversible serialization.
Deprecated. Override destroy() instead to implement custom widget tear-down behavior.
Deprecated, will be removed in 2.0, use handle.remove() instead.
Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions
Parameter | Type | Description |
---|---|---|
handle | Object |
Render a single row.
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Index of the row to render |
Change the number of rows.
Parameter | Type | Description |
---|---|---|
inRowCount | int | Number of rows in the grid. |
Render consecutive rows at once.
Parameter | Type | Description |
---|---|---|
startIndex | Integer | Index of the starting row to render |
howMany | Integer | How many rows to update. |
Update the styles for a row after it's state has changed.
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined |
Watches a property for changes
Parameter | Type | Description |
---|---|---|
name | String |
Optional Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched |
callback | Function | The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value. |
An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:
var watchHandle = obj.watch("foo", callback); watchHandle.unwatch(); // callback won't be called now
This is where widgets do processing for when they stop being active, such as changing CSS classes. See onBlur() for more details.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
item | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
size | undefined | |
req | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
items | undefined | |
req | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
err | undefined | |
req | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove"). If type is a synthetic event like touch.press then returns undefined.
Parameter | Type | Description |
---|---|---|
type | String | Function |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
item | undefined | |
parentInfo | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
item | undefined | |
attribute | undefined | |
oldValue | undefined | |
newValue | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Internal method called when this widget is made visible.
See onShow
for details.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when editing is applied for a given grid cell
Parameter | Type | Description |
---|---|---|
inValue | String | Value from cell editor |
inRowIndex | Integer | Index of the grid row |
inFieldIndex | Integer | Index in the grid's data store |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when editing is applied for a given grid row
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Index of the grid row |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when editing is cancelled for a given grid cell
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Index of the grid row |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event to determine if a grid row may be deselected
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Index of the grid row |
true if the row can be deselected
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
inRowIndex | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a cell is clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a cell context menu is accessed via mouse right click.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a cell is double-clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a cell receives focus.
Parameter | Type | Description |
---|---|---|
inCell | Object | Cell object containing properties of the grid column. |
inRowIndex | Integer | Index of the grid row |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse is down in a header cell.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves out of a cell.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse is over a cell.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of mouse click events.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Called when this widget is being displayed as a popup (ex: a Calendar popped up from a DateTextBox), and it is hidden. This is called from the dijit.popup code, and should not be called directly.
Also used as a parameter for children of dijit/layout/StackContainer or subclasses. Callback if a user tries to close the child. Child will be closed if this function returns true.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Top level handler for Content events
Parameter | Type | Description |
---|---|---|
e | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of mouse double click events.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a grid row is deselected
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Index of the grid row |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
err | undefined | |
req | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a header cell is clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a header cell context menu is accessed via mouse right click.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a header cell is double clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse is down in a header cell.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves out of a header cell.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves over a header cell.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when the grid header is clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when the grid header context menu is accessed via mouse right click.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when the grid header is double clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Top level handler for header events
Parameter | Type | Description |
---|---|---|
e | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves out of the grid header.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves over the grid header.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Called when another widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.
Also called to indicate hide of a dijit.Dialog
, dijit.TooltipDialog
, or dijit.TitlePane
.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
e | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
top level handler for Key Events
Parameter | Type | Description |
---|---|---|
e | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of printable keys being typed.
Parameter | Type | Description |
---|---|---|
event | undefined | key Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of keys being released.
Parameter | Type | Description |
---|---|---|
event | undefined | key Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse button is pressed down.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse is down inside grid row
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object that contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse moves onto this widget.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse moves off of this widget.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves out of any row (data or header).
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse is over any row (data or header).
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Connect to this function to receive notifications of when the mouse button is released.
Parameter | Type | Description |
---|---|---|
event | undefined | mouse Event |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
cellIdx | int |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a row is clicked.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a row context menu is accessed via mouse right click.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a row is double clicked.
Parameter | Type | Description |
---|---|---|
e | Event | decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse is down in a row.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves out of a data row.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when mouse moves over a data row.
Parameter | Type | Description |
---|---|---|
e | Event | Decorated event object which contains reference to grid, cell, and rowIndex |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when a grid row is selected
Parameter | Type | Description |
---|---|---|
inRowIndex | Integer | Index of the grid row |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Called when this widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.
Also called to indicate display of a dijit.Dialog
, dijit.TooltipDialog
, or dijit.TitlePane
.
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Event fired when editing is started for a given grid cell
Parameter | Type | Description |
---|---|---|
inCell | Object | Cell object containing properties of the grid column. |
inRowIndex | Integer | Index of the grid row |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });
Parameter | Type | Description |
---|---|---|
row | undefined |
var btn = new Button(); // when /my/topic is published, this button changes its label to // be the parameter of the topic. btn.subscribe("/my/topic", function(v){ this.set("label", v); });