-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serving up data for treetable via async obervable #24
Comments
Hi @jh0274, yes the component supports data coming in from streams, I can try to point you in the right direction if you provide an example of your use case. |
Hi @mlrv thank you so much for confirming that! So the issue i'm having is that the table renders first with the data that i initialised the 'Node' property with (ie 1, a, 2 - see below) but it's not updating when the async call to the web API returns the complete dataset (via the observable stream). I know the observable stream returns the dataset because i've debugged it to the console.. any help you can give me is much appreciated! Code below.. html: <treetable component.ts: import { Component, OnInit, AfterViewInit } from '@angular/core'; @component({ selectedHero: Hero; constructor( assets: Node = { errorMessage: String; getAssets(): void { assets.Service.ts: import { Injectable } from '@angular/core'; import { Observable, of } from 'rxjs'; import { Node } from 'ng-material-treetable'; @Injectable({ constructor(private http: HttpClient,
} in-memory-data.service.ts (Mock DB): import { InMemoryDbService } from 'angular-in-memory-web-api'; @Injectable({
} |
I also have a similar issue. I load the tree structure once, but I have a way to change the current tree. When the event is triggered for the tree change and all the data is loaded from the Observables the tree still doesn't update. I've checked the network tab and the request is there and it finishes. this.masterDataService.getItemListExplosion(indexKey, refDate, unit, true, 1)
.subscribe((itemListExplosion: IItemListExplosion[]) => {
console.log(this.itemListExplosionToTree(itemListExplosion));
this.treeDataStructure = this.itemListExplosionToTree(itemListExplosion);
}); This is the code in question. |
Hi all! i'm also trying to do this and getting
This exception occurs from the validator.service, because my tree-array is undefined Some kind of ideas? Thanks! |
I added an *ngIf="data" and that seemed to work
|
This commit fixes the issue of the table not updating as the tree passed to it changed. This is done by implementing OnChanges and rerunning initialization code after the tree has changed
Hi!
This component looks great, thank you. I'm currently having issues trying to serve data to the treetable using an observable stream. I know that this works with mat-table, should it also work with your treetable?
Thanks
James
The text was updated successfully, but these errors were encountered: