Say I have the following sample :
<li *ngFor=”let book of observableBooks | async” >
Id: {{book.id}}, Name: {{book.name}}
export class Book { id : string; name: string;}…
observableBooks: Observable<Book[]>
Each time my observableBooks changes, my component responds to it.
Now I want to replace this with jqGrid component.
I’ll do the following :
HTML :
<jqxGrid
[source]=”dataAdapter” [columns]=”columns”
[pageable]=”true” [autoheight]=”true” [sortable]=”true”
[altrows]=”true” [enabletooltips]=”true” [editable]=”true”
[selectionmode]=”‘multiplecellsadvanced'” [columngroups]=”columngroups”>
</jqxGrid>
TS:
this.source: any =
{
localdata: this.observableBooks ,
datatype: ‘array’,
datafields:
[
{ name: ‘id’, type: ‘string’ },
{ name: ‘name’, type: ‘string’ }
]
};
dataAdapter: any = new jqx.dataAdapter(this.source);
Is it correct ? Will the grid reflect the changes when the obsevableBooks is changed outside the component?
Thanks
And the question will