APIs

Show:

Flexberry tree node component with Semantic UI accordion style. Component must be used in combination with flexberry-tree component as a wrapper for those tree nodes, which are placed on the same tree level.

Usage: templates/my-form.hbs

Methods

_actionHandlerIsDefined

(
  • options
)
Boolean private
Returns flag, indicating whether action handler is defined, for action with the specified name, or not.

Parameters:

  • options Object
    Method options
    • actionName String

      Name of component's action for which handler's existence this method should check.

Returns:

Boolean: Flag, indicating whether action handler is defined, for action with the specified name, or not.

_addDynamicProperty

(
  • propertyName
)
private
Adds component's new dynamic property. Gets related value from {{#crossLink "DynamicPropertiesMixin:dynamicProperties:property"}}dynamic properties{{/crossLink}}, and assignes it to related component's property, then attaches observer.

Parameters:

  • propertyName String
    Name of dynamic property that must be added.

_dynamicPropertiesDidChange

() private
Observes & handles any changes in {{#crossLink "DynamicPropertiesMixin/dynamicProperties:property"}}'dynamicProperties'{{/crossLink}}, assigns actual values to a component's related properties (including initialization moment).

_hasContentDidChange

() private

Observes changes in '_hasContent' flag, and collapses node if '_hasContent' became false.

_removeDynamicProperties

() private
Removes component's all previously added dynamic properties. Removes related component's properties & observers.

_removeDynamicProperty

(
  • propertyName
)
private
Removes component's previously added dynamic property. Removes related component's property & observer.

Parameters:

  • propertyName String
    Name of dynamic property that must be removed.

actions.onHeaderClick

(
  • [jQuery event object]
)

Handles tree node header's 'click' event. Prevents 'click' event from bubbling for leaf nodes. Invokes component's 'headerClick' action. Invokes component's 'beforeExpand' action. Invokes component's 'beforeCollapse' action.

Parameters:

attachEventHandler

(
  • options
)
Attaches event handler for a given event-target. Also remembers attached handlers and related event-targets for clean up logic which will be executed before component will be destroyed, so use this method instead of explicit calls to [jQuery.on method](http://api.jquery.com/on/) to avoid possible memory leaks.

Parameters:

closeModalDialog

()
Close current modal window if it exists.

createdModalDialog

(
  • modalDialog
)
Handles create modal window action. It saves created window to have opportunity to close it later.

Parameters:

  • modalDialog JQuery
    Created modal window.

detachAllEventHandlers

()
Detaches all event-handlers remembered in metadata when event-handlers were attached through {{#crossLink "DomActionsMixin/attachEventHandler:method"}}'attachEventHandler' method {{/crossLink}}.

detachEventHandler

(
  • options
)
Detaches event-handler from a given event-target. Also cleans up metadata remembered when event-handler was attached through {{#crossLink "DomActionsMixin/attachEventHandler:method"}}'attachEventHandler' method {{/crossLink}}.

Parameters:

send

(
  • actionName
  • args
)
Any
Overridden ['send' method](https://github.com/emberjs/ember.js/blob/v2.7.0/packages/ember-runtime/lib/mixins/action_handler.js#L145). Method logic still the same, but method now returns value returned by the action handler. `

Parameters:

  • actionName String
    Name of the action that must be triggered.
  • args
    Arguments that must be passed to action.

Returns:

Any: Returns value returned by action handler.

sendingActions.beforeCollapse

(
  • e
)

Component's action invoking before node will be collapsed. Node can be prevented from being collapsed with call to action event object's 'originalEvent.stopPropagation()'.

Parameters:

sendingActions.beforeExpand

(
  • e
)

Component's action invoking before node will be expanded. Node can be prevented from being expanded with call to action event object's 'originalEvent.stopPropagation()'.

Parameters:

sendingActions.headerClick

(
  • e
)

Component's action invoking when tree node's header has been clicked.

Parameters:

Properties

_availableDomEvents

Object private
Dictionary containing names of DOM-events available for component's wrapping DOM-element and component's actions names related to them.

_componentWrapperIsAvailable

Boolean private
Flag: indicates whether component's wrapper DOM-element is available for select now.

_dynamicActions

Object private
Component's dynamic actions from {{#crossLink "DynamicActionsMixin:dynamicActions:property"}}'dynamicActions' property{{/crossLink}}, mapped from array into flat [JSON-object](http://www.json.org/).

_dynamicPropertiesMetadata

Object[] private
Array with objects containing names of already assigned {{#crossLink "DynamicPropertiesMixin:dynamicProperties:property"}}dynamic properties{{/crossLink}} and observer handlers related to them. Each object in array has following structure: { propertyName: '...', propertyObserverHandler: function() { ... } }.

Default: null

_eventsMetadata

Object[] private
Array with objects containing selected event targets & handlers attached to them. Each object in array has following structure: { eventTarget: ..., attachedEventHandlers: { click: [function() {}, function() {}, ...], dblclick: [function() {}, function() {}, ...], ... } }.

Default: null

_hasContent

Boolean private

Flag: indicates whether some nested content is defined (some yield markup or {{#crossLink "FlexberryTreenodeComponent/nodes:property"}}'nodes'{{/childNodes}} are defined).

_hasNodes

Boolean private

Flag: indicates whether some {{#crossLink "FlexberryTreenodeComponent/nodes:property"}}tree 'nodes'{{/childNodes}} are defined.

_openedModalDialog

JQuery
Current opened modal window.

Default: undefined

_requiredActions

String[]
Component's required actions names. For actions enumerated in this array an assertion exceptions will be thrown, if actions handlers are not defined for them.

Default: null

caption

String

Tree node's caption (will be displayed in node's header).

Default: null

classNames

String[]

Component's wrapping

CSS-classes names.

Any other CSS-class names can be added through component's 'class' property.

Default: ['flexberry-treenode']

dynamicActions

DynamicActionObject[]
Component's dynamic actions. If component consumes it's inner structure as [JSON-object](http://www.json.org/) or [Ember-object](https://emberjs.com/api/ember/release/classes/EmberObject) and there is no way to attach action handlers explicitly in hbs-markup, then you can define {{#crossLink "DynamicActionObject"}}dynamic actions{{/crossLink}} somewhere in code & pass defined array into this component's property.

Default: null

dynamicProperties

Object
Object containing dynamic properties that must be assigned to component using {{#crossLink "DynamicPropertiesMixin"}}dynamic-properties mixin{{/crossLink}}.

Default: null

flexberryClassNames

Object static

Component's CSS-classes names. JSON-object containing string constants with CSS-classes names related to component's hbs-markup elements.

Sub-properties:

  • prefix String

    Component's CSS-class names prefix ('flexberry-treenode').

  • wrapper String

    Component's wrapping

    CSS-class name ('flexberry-treenode').

  • header String

    Component's header

    CSS-class name ('flexberry-treenode-header').

  • content String

    Component's content

    CSS-class name ('flexberry-treenode-content').

  • expandCollapseIcon String

    Component's expand/collapse icon CSS-class name ('flexberry-treenode-expand-collapse-icon').

  • preventExpandCollapse String

    Component's CSS-class name to prevent nodes expand/collapse animation ('flexberry-treenode-prevent-expand-collapse').

isTagless

Boolean
Flag: indicates whether component is tagless or not (has empty [tagName](https://emberjs.com/api/ember/release/classes/Component#property_tagName) or not).

nodes

FlexberryTreenodeObject

Child nodes. This property is optional and must be used when there are too many child nodes, and you don't want to define them explicitly in the .hbs markup, then you can define nodes array somewhere in code & pass defined array to this component's property.

Default: null