ContentSearchBox

Summary

Location

The node to display the popup around.
Can be set via a data-dojo-attach-point assignment.
If missing, then domNode will be used.

_arrowWrapperNode

Will set CSS class dijitUpArrow, dijitDownArrow, dijitRightArrow etc. on this node depending
on where the drop down is set to be positioned.
Can be set via a data-dojo-attach-point assignment.
If missing, then _buttonNode will be used.

_attrPairNames

_blankGif

Path to a blank 1x1 image.
Used by <img> nodes in templates that really get their image via CSS background-image.

_blankValue

_buttonInputDisabled

_buttonNode

The button/icon/node to click to display the drop down.
Can be set via a data-dojo-attach-point assignment.
If missing, then either focusNode or domNode (if focusNode is also missing) will be used.

_earlyTemplatedStartup

A fallback to preserve the 1.0 - 1.3 behavior of children in
templates having their startup called before the parent widget
fires postCreate. Defaults to 'false', causing child widgets to
have their .startup() called immediately before a parent widget
.startup(), but always after the parent .postCreate(). Set to
'true' to re-enable to previous, arguably broken, behavior.

_focusManager

_popupStateNode

The node to set the popupActive class on.
Can be set via a data-dojo-attach-point assignment.
If missing, then focusNode or _buttonNode (if focusNode is missing) will be used.

_setClassAttr

_setDirAttr

_setIdAttr

_setLangAttr

_setTabIndexAttr

_setTypeAttr

_singleNodeTemplate

_skipNodeCache

_started

startup() has completed.

_stopClickEvents

When set to false, the click events will not be stopped, in
case you want to use them in your subclass

active

True if mouse was pressed while over this widget, and hasn't been released yet

alt

Corresponds to the native HTML <input> element's attribute.

aria-label

attributeMap

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:

TODO: move declaration to MappedTextBox?
Problem is that ComboBox references displayedValue,
for benefit of FilteringSelect.

dndType

Defines a type of widget.

domNode

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.

dropDown

The widget to display as a popup. This widget must be
defined before the startup function is called.

dropDownPosition

This variable controls the position of the drop down.
It's an array of strings with the following values:

before: places drop down to the left of the target node/widget, or to the right in
the case of RTL scripts like Hebrew and Arabic

after: places drop down to the right of the target node/widget, or to the left in
the case of RTL scripts like Hebrew and Arabic

above: drop down goes above target node

below: drop down goes below target node

The list is positions is tried, in order, until a position is found where the drop down fits
within the viewport.

encodeSearchText

fetchProperties

Mixin to the store's fetch.
For example, to set the sort order of the ComboBox menu, pass:

{ sort: [{attribute:"name",descending: true}] }

To override the default queryOptions so that deep=false, do:

{ queryOptions: {ignoreCase: true, deep: false} }

focused

This widget or a widget it contains has focus, or is "active" because
it was recently clicked.

forceWidth

Set to true to make the drop down exactly as wide as this
widget. Overrides autoWidth.

highlightMatch

One of: "first", "all" or "none".

If the ComboBox/FilteringSelect opens with the search results and the searched
string can be found, it will be highlighted. If set to "all"
then will probably want to change queryExpr parameter to '${0}'

Highlighting is only performed when labelType is "text", so as to not
interfere with any HTML markup an HTML label might contain.

hovering

True if cursor is over this widget

id

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.

ignoreCase

Set true if the query should ignore case when matching possible items

intermediateChanges

Fires onChange for each value change or only on demand

item

This is the item returned by the dojo/store/api/Store implementation that
provides the data for this ComboBox, it's the currently selected item.

labelAttr

The entries in the drop down list come from this attribute in the
dojo.data items.
If not specified, the searchAttr attribute is used instead.

labelType

Specifies how to interpret the labelAttr in the data store items.
Can be "html" or "text".

lang

Rarely used. Overrides the default Dojo locale used to render this widget,
as defined by the HTML LANG attribute.
Value must be among the list of locales specified during by the Dojo bootstrap,
formatted according to RFC 3066 (like en-us).

lowercase

Converts all characters to lowercase if true. Default is false.

maxHeight

The max height for our dropdown.
Any dropdown taller than this will have scrollbars.
Set to 0 for no max height, or -1 to limit height to available space in viewport

maxLength

HTML INPUT tag maxLength declaration.

minimumNumberOfChar

The minimum number of character that is valid for search.
tags:
Protected

name

Name used when submitting form; same as "name" attribute or plain HTML elements

ownerDocument

The document this widget belongs to. If not specified to constructor, will default to
srcNodeRef.ownerDocument, or if no sourceRef specified, then to dojo/_base/window::doc

pageSize

Specifies a maximum size (in pixels) for this widget when resized by a splitter.

placeHolder

propercase

Converts the first character of each word to uppercase if true.

query

A query that can be passed to store to initially filter the items.
ComboBox overwrites any reference to the searchAttr and sets it to the queryExpr with the user's input substituted.

queryExpr

This specifies what query ComboBox/FilteringSelect sends to the data store,
based on what the user has typed. Changing this expression will modify
whether the drop down shows only exact matches, a "starting with" match,
etc. Use it in conjunction with highlightMatch.
dojo.data query expression pattern.
${0} will be substituted for the user text.
* is used for wildcards.
${0}* means "starts with", *${0}* means "contains", ${0} means "is"

readOnly

Should this widget respond to user input?
In markup, this is specified as "readOnly".
Similar to disabled except readOnly form values are submitted.

res

Resource object, for getting text.
tags:
Protected

scrollOnFocus

On focus, should this widget scroll into view?

searchAttr

Search for items in the data store where this attribute (in the item)
matches what the user typed

searchDelay

Delay in milliseconds between when user types something and we start
searching based on that value

selectOnClick

If true, all text will be selected when focused with mouse

srcNodeRef

pointer to original DOM node

store

Reference to data provider object used by this ComboBox.
The store must accept an object hash of properties for its query. See query and queryExpr for details.

style

HTML style attributes as cssText string or name/value hash

tabIndex

Order fields are traversed when user hits the tab key

templatePath

Path to template (HTML file) for this widget relative to dojo.baseUrl.
Deprecated: use templateString with require([... "dojo/text!..."], ...) instead

templateString

textDir

Bi-directional support, the main variable which is responsible for the direction of the text.
The text direction can be different than the GUI direction by using this parameter in creation
of a widget.

Allowed values:

"ltr"

"rtl"

"auto" - contextual the direction of a text defined by first strong letter.

By default is as the page direction.

title

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.

tooltip

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.

trim

Removes leading and trailing whitespace if true. Default is false.

type

Corresponds to the native HTML <input> element's attribute.

uppercase

Converts all characters to uppercase if true. Default is false.

value

Corresponds to the native HTML <input> element's attribute.

Methods

_fillContent ( source
)

Relocate source contents to templated container node.
this.containerNode must be able to receive children, or exceptions will be thrown.

Parameters

Name

Summary

Type

Usage

source

DomNode

required

_refreshState ( )

After the user types some characters, etc., this method is
called to check the field for validity etc. The base method
in dijit/form/TextBox does nothing, but subclasses override.

_setStyleAttr ( value
)

Sets the style attribute of the widget according to value,
which is either a hash like {height: "5px", width: "3px"}
or a plain string

Parameters

Name

Summary

Type

Usage

value

String||Object

required

applyTextDir ( element , text
)

The function overridden in the _BidiSupport module,
originally used for setting element.dir according to this.textDir.
In this case does nothing.

Parameters

Name

Summary

Type

Usage

element

DOMNode

required

text

String

required

closeDropDown ( focus
)

Closes the drop down on this widget

Parameters

Name

Summary

Type

Usage

focus

If true, refocuses the button widget

Boolean

required

compare ( val1 , val2
)

Compare 2 values (as returned by get('value') for this widget).

Parameters

Name

Summary

Type

Usage

val1

anything

required

val2

anything

required

connect ( obj , event , method
)

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.

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).

Parameters

Name

Summary

Type

Usage

fcn

undefined

required

delay

undefined

required

destroyRendering ( preserveDom
)

Destroys the DOM nodes associated with this widget

Parameters

Name

Summary

Type

Usage

preserveDom

If true, this method will leave the original DOM structure alone
during tear-down. Note: this will not work with _Templated
widgets yet.

Boolean

optional

disconnect ( handle
)

Deprecated, will be removed in 2.0, use handle.remove() instead.

Disconnects handle created by connect.

Parameters

Name

Summary

Type

Usage

handle

undefined

required

doHighlight ( label , find
)

Highlights the string entered by the user in the menu. By default this
highlights the first occurrence found. Override this method
to implement your custom highlighting.

Parameters

Name

Summary

Type

Usage

label

String

required

find

String

required

dropDownClass ( )

Dropdown widget class, which would be used to create a widget, to show the search result.
Subclasses should specify this.

emit ( type , eventObj , callbackArgs
)

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).

Parameters

Name

Summary

Type

Usage

type

String

required

eventObj

Object

optional

callbackArgs

Array

optional

filter ( val
)

Auto-corrections (such as trimming) that are applied to textbox
value on blur or form submit.

Parameters

Name

Summary

Type

Usage

val

undefined

required

format ( value , constraints
)

Replaceable function to convert a value to a properly formatted string.

Parameters

Name

Summary

Type

Usage

value

String

required

constraints

Object

required

getDisplayedValue ( )

Deprecated. Use get('displayedValue') instead.

getTextDir ( text , originalDir
)

Return direction of the text.
The function overridden in the _BidiSupport module,
its main purpose is to calculate the direction of the
text, if was defined by the programmer through textDir.

Parameters

Name

Summary

Type

Usage

text

String

required

originalDir

String

required

isLeftToRight ( )

Return this widget's explicit or implicit orientation (true for LTR, false for RTL)

isLoaded ( )

Returns true if the dropdown exists and it's data is loaded. This can
be overridden in order to force a call to loadDropDown().

loadAndOpenDropDown ( )

Creates the drop down if it doesn't exist, loads the data
if there's an href and it hasn't been loaded yet, and
then opens the drop down. This is basically a callback when the
user presses the down arrow button to open the drop down.

loadDropDown ( loadCallback
)

Creates the drop down if it doesn't exist, loads the data
if there's an href and it hasn't been loaded yet, and then calls
the given callback.

Parameters

Name

Summary

Type

Usage

loadCallback

Function

required

onBlur ( )

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.

onChange ( newValue
)

Callback when this widget's value is changed.

Parameters

Name

Summary

Type

Usage

newValue

undefined

required

onClick ( event
)

Connect to this function to receive notifications of mouse click events.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onClose ( )

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.

onDblClick ( event
)

Connect to this function to receive notifications of mouse double click events.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onFocus ( )

Called when the widget becomes "active" because
it or a widget inside of it either has focus, or has recently
been clicked.

onHide ( )

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.

onKeyDown ( event
)

Connect to this function to receive notifications of keys being pressed down.

Parameters

Name

Summary

Type

Usage

event

key Event

undefined

required

onKeyPress ( event
)

Connect to this function to receive notifications of printable keys being typed.

Parameters

Name

Summary

Type

Usage

event

key Event

undefined

required

onKeyUp ( event
)

Connect to this function to receive notifications of keys being released.

Parameters

Name

Summary

Type

Usage

event

key Event

undefined

required

onMouseDown ( event
)

Connect to this function to receive notifications of when the mouse button is pressed down.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseEnter ( event
)

Connect to this function to receive notifications of when the mouse moves onto this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseLeave ( event
)

Connect to this function to receive notifications of when the mouse moves off of this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseMove ( event
)

Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseOut ( event
)

Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseOver ( event
)

Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onMouseUp ( event
)

Connect to this function to receive notifications of when the mouse button is released.

Parameters

Name

Summary

Type

Usage

event

mouse Event

undefined

required

onSearch ( results , query , options
)

Callback when a search completes.

Parameters

Name

Summary

Type

Usage

results

An array of items from the originating _SearchMixin's store.

Object

required

query

A copy of the originating _SearchMixin's query property.

Object

required

options

The additional parameters sent to the originating _SearchMixin's store, including: start, count, queryOptions.

Object

required

onShow ( )

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.

openDropDown ( )

Opens the dropdown for this widget. To be called only when this.dropDown
has been created and is ready to display (ie, it's data is loaded).

own ( )

Track specified handles and remove/destroy them when this instance is destroyed, unless they were
already removed/destroyed manually.

parse ( value , constraints
)

Replaceable function to convert a formatted string to a value

Parameters

Name

Summary

Type

Usage

value

String

required

constraints

Object

required

postCreate ( )

Override to:
- mixin additional query params into query before _startSearch
- connect to onSelect event of dropDown, to forward it to ContentSearchBox after _startSearch

setAttribute ( attr , value
)

Deprecated. Use set() instead.

Parameters

Name

Summary

Type

Usage

attr

String

required

value

anything

required

setDisplayedValue ( value
)

Deprecated. Use set('displayedValue', ...) instead.

Parameters

Name

Summary

Type

Usage

value

String

required

subscribe ( t , method
)

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.

Parameters

Name

Summary

Type

Usage

t

The topic

String

required

method

The callback

Function

required

Examples

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);
});

toggleDropDown ( )

Callback when the user presses the down arrow button or presses
the down arrow key to open/close the drop down.
Toggle the drop-down widget; if it is up, close it, if not, open it