Class: RelationWidget

XV. RelationWidget

A picker control that implements a dropdown list of items which can be selected.
Unlike the XV.PickerWidget, the collection is not stored local to the widget.
Derived from enyo.Control.

new RelationWidget()

Source:

Extends

  • enyo.Control

Methods

addParameter(Parameter, Editable) → {Object}

Add a parameter to the query object on the widget. Parameter conventions should follow those described in the documentation for `XM.Collection`.
Parameters:
Name Type Description
Parameter Object
Editable Boolean default false. If true user can edit parameter selection in search.
Source:
Returns:
Receiver
Type
Object

autocomplete()

Fill the value with the selected choice.
Source:

clear()

Empty out the widget
Source:

disabledChanged()

Source:
To Do:
  • Document the disabledChanged method.

fetchCollection()

Query the database. Used by both autocomplete and keyup.
Source:

focus()

Source:
To Do:
  • Document the focus method.

getValueToString()

Source:
To Do:
  • Document the getValueToString method.

itemSelected()

Source:
To Do:
  • Document the itemSelected method.

keyDown()

Source:
To Do:
  • Revisit or remove after ENYO-1104 is resolved.

keyUp()

We will typically want to query the database upon every keystroke
Source:

labelChanged()

Source:
To Do:
  • Document the labelChanged method.

listChanged()

Source:
To Do:
  • Document the listChanged method.
Source:
To Do:
  • Document the menuItemSelected method.

modelChanged()

Source:
To Do:
  • Document the modelChanged method.

placeholderChanged()

When we get a placeholder we want to actually display it.
Source:

receiveBlur()

Source:
To Do:
  • Document the receiveBlur method.

receiveFocus()

Source:
To Do:
  • Document the receiveFocus method.

relationSelected()

Source:
To Do:
  • Document the relationSelected method.

removeParameter(Attribute) → {Object}

Removes a query parameter by attribute name from the widget's query object.
Parameters:
Name Type Description
Attribute String
Source:
Returns:
Receiver
Type
Object

setValue(Value;, options)

Programatically sets the value of this widget. If an id is set then the correct model will be fetched and this function will be called again recursively with the model. In case of "order" models, each order's workspace is different depending on the order type. This causes the Workspace var to be null so get the value from the getWorkspace defined on the relation.js sub-kind.
Parameters:
Name Type Description
Value; XM.Model | Number | String can be a model or the id of a model.
options Object
Source: