angular / angular/components

Mat-tree :Tree with nested nodes adding child doesnt update the view.

Offen
#11,381 59 Kommentare 52 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/tree P4
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

#### Bug:

When using mat-nested-tree-node with a nested datasource if you add a child to an existing parent it does not update the view.

#### What is the expected behavior?
Well if you change or add a child to an existing parent in the nestedDataSource it should update the tree.

#### What is the current behavior?
It does not update the view when adding a child to an existing parent to the nestedDataStructure .

#### What is the use-case or motivation for changing an existing behavior?

Well in my case i need to update the view since i add/delete nodes .

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
versions 6 (Chrome ver 66)

#### Is there anything else we should know?
I found an workaround:
refreshTree(){
let _data = this.nestedDataSource.data;
this.nestedDataSource.data = null;
this.nestedDataSource.data = _data;
}

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit mat-nested-tree-node und dem im Issue beschriebenen Aktualisierungspfad von nestedDataSource, indem du das Problem reproduzierst, indem du einem bestehenden Parent ein Child hinzufügst. Vergleiche die Ansicht mit dem dokumentierten Workaround refreshTree; abgeschlossen ist die Aufgabe, wenn der verschachtelte Baum hinzugefügte oder gelöschte Nodes ohne diesen Workaround widerspiegelt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.