0

I am trying to override shift+click to select the multiple nodes in the tree. I do the same way as in the tutorial

import { ITreeOptions, TreeNode,TREE_ACTIONS,KEYS,IActionMapping} from 'angular-tree-component';
actionMapping: IActionMapping = {
    mouse: {
      click: (tree, node, $event) => {
        $event.shiftKey
          ? TREE_ACTIONS.TOGGLE_SELECTED_MULTI(tree, node, $event)
          : TREE_ACTIONS.TOGGLE_SELECTED(tree, node, $event)
      }
    }
  };
@ViewChild('tree') tree: any;
 treeOptions: ITreeOptions = {
    actionMapping:this.actionMapping,
    getChildren: this.getChildren.bind(this),
    useVirtualScroll: true,
    nodeHeight: 22
 };
<tree-root #tree [nodes]="nodes" [focused]="true" [options]="treeOptions" (updateData)="treeUpdate()" (moveNode)="onMoveNode($event)">
...
</tree-root>

but it does not work, property 'TOGGLE_SELECTED_MULTI' does not exist on TREE_ACTIONS.

1 Answer 1

0
const actionMapping:IActionMapping = {
  mouse: {
    click: TREE_ACTIONS.TOGGLE_ACTIVE_MULTI
  }
};

public options = { 
    actionMapping
  };

And HTML Like

<tree-root [nodes]="nodes" [options]="options"></tree-root>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.