SummaryConcept

SummaryConcept

new SummaryConcept(nameopt, optionsopt)

Source:

Represents the top-level node of a tree which should be displayed using a different UX to the more usual DisplayVariablesConcept. Intended for use when the tree is huge, and would take up too much space in the UI. Contains an items array of Concepts.

Parameters:
Name Type Attributes Default Description
name String <optional>
'Conditions'

Display name of this concept.

options Object <optional>

Options, as per DisplayVariablesConcept.

Extends

Members

allowMultiple :Boolean

Source:
Inherited From:

Gets or sets a flag for whether more than one checkbox can be selected at a time. Default false.

Type:
  • Boolean

color :String

Source:
Inherited From:

String describing the color of this node, if applicable. This property is observable.

Type:
  • String

exclusiveChildIds :Array.<String>

Source:
Inherited From:

Gets or sets a list of child ids which cannot be selected at the same time as any other child. Defaults to []. Only relevant with allowMultiple = true. Eg. Suppose the child concepts have ids "10" for 10 year olds, etc, plus "ALL" for all ages, "U21" and "21PLUS" for under and over 21 year olds. Then by specifying ["ALL", "U21", "21PLUS"], when the user selects one of these values, any other values will be unselected. And when the user selects any other value (eg. "10"), if any of these values were selected, they will be unselected.

Type:
  • Array.<String>

getColorCallback :function

Source:
Inherited From:

Gets or sets a function with no arguments that returns a color for the VariableConcept. If undefined, no color is set (the default).

Type:
  • function

id :String

Source:
Inherited From:

Gets or sets the id of the concept item. By default this is the same as the name. It is allowed to be different eg. for csv files with tersely-named columns.

Type:
  • String

isActive :Boolean

Source:
Inherited From:

Gets or sets a value indicating whether this variable is currently active. This property is observable.

Type:
  • Boolean

isOpen :Boolean

Source:
Inherited From:

Gets or sets a value indicating whether this concept item is currently open. When an item is open, its child items (if any) are visible. Default true.

Type:
  • Boolean

isSelectable :Boolean

Source:
Inherited From:

Gets or sets a flag indicating whether this node is selectable.

Type:
  • Boolean

isVisible :Boolean

Source:
Inherited From:

Gets or sets a value indicating whether this concept is visible. Defaults to true.

Type:
  • Boolean

items :Array.<Concept>

Source:
Inherited From:

Gets or sets the array of concepts contained in this group. If options.items is present, each item's parent property is overridden with this.

Type:

name :String

Source:
Inherited From:

Gets or sets the name of the concept item. This property is observable.

Type:
  • String

parent :Array.<VariableConcept>

Source:
Inherited From:

Gets or sets the parent for a node. This property is observable.

Type:

requireSomeActive :Boolean

Source:
Inherited From:

Gets or sets a flag for whether at least one checkbox must be selected at all times. Default false.

Type:
  • Boolean

toggleActiveCallback :function

Source:
Inherited From:

Gets or sets a function which is called whenever a child item is successfully toggled. Its sole argument is the toggled child item.

Type:
  • function

Methods

closeDescendants()

Source:

Sets isOpen = false on all descendants.

getNodes(condition) → {Array.<Concept>}

Source:
Inherited From:

Gets a flat array of all of this concept's descendants, including itself, which meet a given condition.

Parameters:
Name Type Description
condition function

A function of a concept, which returns a boolean.

Returns:
Type
Array.<Concept>

toggleActive()

Source:
Inherited From:

Toggles the VariableConcept#isActive property, by using the parent's toggleActiveItem (if defined), or else manually.

toggleActiveItem(concept)

Source:
Inherited From:

If appropriate, based on this.allowMultiple, this.requireSomeActive and this.exclusiveChildIds, sets the VariableConcept#isActive property on all children, so that only the provided concept is activated. This is called by the VariableConcept's toggleActive function. If not appropriate, simply toggles the concept without changing any others. (For backwards compatibility, VariableConcept does not call this function if there's no possibility it's needed.)

Parameters:
Name Type Description
concept VariableConcept

The concept to make active/inactive.

toggleOpen()

Source:
Inherited From:

Toggles the Concept#isOpen property. If this item's list of children is open, calling this method will close it. If the list is closed, calling this method will open it.