How to use the ember-flexberry/objects/tree-node.create function in ember-flexberry

To help you get started, we’ve selected a few ember-flexberry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flexberry / ember-flexberry-designer / addon / controllers / new-platform-flexberry-web-designer-appstruct-list-form.js View on Github external
_jsTreeToFlexberryTree: function (jsTree) {
    if (!jsTree) return null;
    let ret = Ember.A([]);
    for (let i=0; i < jsTree.length; i++) {
      let node = jsTree[i];
      let caption = node.caption;
      let nodes = node.nodes;
      if (nodes && nodes.length > 0) {
        nodes = this._jsTreeToFlexberryTree(nodes);
      } else {
        nodes = Ember.A([]);
      }
      let treeNodeObject = TreeNodeObject.create({ caption: caption, nodes:nodes });
      ret.addObject(treeNodeObject);
    }
    return ret;
  },