ng2-tree icon indicating copy to clipboard operation
ng2-tree copied to clipboard

How to make the tree readonly , and prevent user to modify it

Open khaliltayseerhamad opened this issue 6 years ago • 2 comments

I want to prevent the user to add or modify or move the nodes what shall I add 👍

<tree *ngFor="let obj of tree" [tree]="obj" (nodeSelected)="logEvent($event)" >

khaliltayseerhamad avatar Apr 10 '18 06:04 khaliltayseerhamad

Please note that I have added the settings but still is not working : <tree *ngFor="let obj of tree" [tree]="obj" (nodeSelected)="logEvent($event)" [settings]="settings">

settings= new TreeModelSettings();

ngOnInit() { this.settings.static = true; this.settings.leftMenu = false;

}

khaliltayseerhamad avatar Apr 10 '18 06:04 khaliltayseerhamad

Hello! TreeModelSettings() must be in tree object, like manual says

https://github.com/valor-software/ng2-tree#configure-node-via-treemodelsettings

bind settings in html tag requrire 'settings' was Ng2TreeSettings, check this.

https://github.com/valor-software/ng2-tree#settings

horsacode avatar Apr 11 '18 12:04 horsacode