Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

206
Views
Cómo personalizar el modelo de selección del nodo del árbol de alfombras para deshabilitar algunas casillas de verificación donde se seleccionó otra

Estoy usando el nodo de árbol mat para obtener un nodo de selección del usuario como este:

 export class SelectDataComponent implements OnInit { @Output() selectedList=new EventEmitter<any[]>(); @Input() exportMode: boolean; private _transformer = (node: DeviceNode, level: number) => ({ expandable: !!node.children && node.children.length > 0, id:node.id, name: node.name, level: level, }); treeControl = new FlatTreeControl<ExampleFlatNode>( node => node.level, node => node.expandable); treeFlattener = new MatTreeFlattener( this._transformer, node => node.level, node => node.expandable, node => node.children); dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); checklistSelection = new SelectionModel<ExampleFlatNode>(true /* multiple */); tree: any; constructor(private _propertyService: PropertyService) { } hasChild = (_: number, node: ExampleFlatNode) => node.expandable; ngOnInit() { this._propertyService.getTreeNodes().subscribe((respP)=>{ this.tree=JSON.parse(respP.data); //this.tree =TREE_DATA; this.dataSource.data=this.tree; }); }; todoItemSelectionToggle(node: ExampleFlatNode): void { this.checklistSelection.toggle(node); const descendants = this.treeControl.getDescendants(node); this.checklistSelection.isSelected(node) ? this.checklistSelection.select(...descendants) : this.checklistSelection.deselect(...descendants); descendants.every(child => this.checklistSelection.isSelected(child) ); } todoLeafItemSelectionToggle(node: ExampleFlatNode): void { this.checklistSelection.toggle(node); const a=of(this.checklistSelection.selected); } public sendToDataList(){ if (this.checklistSelection.selected.length===0) { console.log('error'); } else { const b=this.selectedList.emit(this.checklistSelection.selected); } } public clearList() { this.checklistSelection.clear(); } }

¿Cómo puedo desactivar otro nodo seleccionando un nodo? Es decir, si se selecciona 'A', la casilla de verificación 'B' estará deshabilitada

Mi objetivo es imponer restricciones de selección de datos para que los nodos 'A' y 'B' no se seleccionen al mismo tiempo.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!