Flexgrid dynamic colums

Posted by: giuseppe.russo on 26 October 2018, 2:37 am EST

    • Post Options:
    • Link

    Posted 26 October 2018, 2:37 am EST

    I’m trying to create a grid based on a complex datasource.

    so far I have something like:

    <wj-flex-grid [itemsSource]=“items” [selectionMode]=“‘Row’” [autoGenerateColumns]=“false” #grid>

    <wj-flex-grid-column [header]=“Name” [binding]=“‘name’” [width]=“300”>



    <ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” *ngFor=“let item of items, let i=index” let-item=“item”>

    {{item.value}}






    the items in the itemsource has a property which is a collection how would I iterate it?

    if I try *ngFor=“let item of items.myCollection” it would not work nor *ngFor=“let item of myCollection”

    could you please advise?

  • Posted 26 October 2018, 4:24 am EST

    Hi,

    The issue here is that you are trying to use *ngFor on wjFlexGridCellTemplate, instead you need to use *ngFor on some element inside wjFlexGridCellTemplate.

    Please refer to the following sample: https://stackblitz.com/edit/angular-hjp7o5?file=app%2Fapp.component.html

    If this does not solve your problem then please feel free to explain more about your requirement.

    ~Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels