@angular/material/tree#MatTreeFlatDataSource TypeScript Examples

The following examples show how to use @angular/material/tree#MatTreeFlatDataSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: channel-favorites.component.ts    From qd-messages-ts with GNU Affero General Public License v3.0 6 votes vote down vote up
constructor(private cd: ChangeDetectorRef, private database: ChannelFavoritesDatabase,private ui: UiService,private dialog:NbDialogService,private nbMenuService: NbMenuService, private q: QuestOSService) {

    this.itemClickSub = this.nbMenuService.onItemClick().subscribe( (menuItem) => {

        // if(String(menuItem.item.title) == 'Add Favorite'){
        //     this.getFavoriteFolderList();
        //     this.open(this.importPop);
        // }
       if(String(menuItem.item.title) == 'New Favorite Folder'){
            this.getFavoriteFolderList();
            this.open(this.newFavoriteFolderPop);
        }
    });



    this.database.setQOS(this.q);

    this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel, this.isExpandable, this.getChildren);
    this.treeControl = new FlatTreeControl<TodoItemFlatNode>(this.getLevel, this.isExpandable);
    this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);


    }
Example #2
Source File: channel-list.component.ts    From qd-messages-ts with GNU Affero General Public License v3.0 6 votes vote down vote up
constructor(private cd: ChangeDetectorRef, private database: ChecklistDatabase,private ui: UiService,private dialog:NbDialogService,private nbMenuService: NbMenuService, private q: QuestOSService) {

    this.itemClickSub = this.nbMenuService.onItemClick().subscribe( (menuItem) => {
       if(String(menuItem.item.title) == 'New Channel'){
          this.getChannelFolderList();
          this.open(this.createPop);
        }
        else if(String(menuItem.item.title) == 'Join Channel'){
            this.getChannelFolderList();
            this.open(this.importPop);
        }
        else if(String(menuItem.item.title) == 'New Folder'){
            this.getChannelFolderList();
            this.open(this.folderPop);
        }
    });



    this.database.setQOS(this.q);

    this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel, this.isExpandable, this.getChildren);
    this.treeControl = new FlatTreeControl<TodoItemFlatNode>(this.getLevel, this.isExpandable);
    this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);


    }
Example #3
Source File: checkbox-tree.component.ts    From matx-angular with MIT License 6 votes vote down vote up
constructor(private database: ChecklistDatabase) {
  this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel,
    this.isExpandable, this.getChildren);
  this.treeControl = new FlatTreeControl<TodoItemFlatNode>(this.getLevel, this.isExpandable);
  this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);

  database.dataChange.subscribe(data => {
    this.dataSource.data = data;
  });
}
Example #4
Source File: channel-favorites.component.ts    From qd-messages-ts with GNU Affero General Public License v3.0 5 votes vote down vote up
dataSource: MatTreeFlatDataSource<TodoItemNode, TodoItemFlatNode>;
Example #5
Source File: channel-list.component.ts    From qd-messages-ts with GNU Affero General Public License v3.0 5 votes vote down vote up
dataSource: MatTreeFlatDataSource<TodoItemNode, TodoItemFlatNode>;
Example #6
Source File: items.component.ts    From VIR with MIT License 5 votes vote down vote up
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener)
Example #7
Source File: checkbox-tree.component.ts    From matx-angular with MIT License 5 votes vote down vote up
dataSource: MatTreeFlatDataSource<TodoItemNode, TodoItemFlatNode>;
Example #8
Source File: flat-tree.component.ts    From matx-angular with MIT License 5 votes vote down vote up
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);