Bind dynamic data based on columdef json

Posted by: bemes9226 on 23 November 2020, 10:34 am EST

  • Posted 23 November 2020, 10:34 am EST

    i have get the json data from db which having columndefination values"binding,header,visible,width,datatype,id".

    actually i need to bind data based id or datatype dynamically.some of places i have dropdown.

    check below json link:

    http://www.json-generator.com/api/json/get/bVkxzBVALC?indent=2

    i have separate json for data for itemsource.

    am using angular.

  • Posted 24 November 2020, 4:42 am EST

    Hi,

    You may use the *ngFor to bind columns dynamically. Please refer to the following code snippet and the sample demonstrating the same:

    <wj-flex-grid #grid [itemsSource]="data" (initialized)="initGrid(grid)">
      <wj-flex-grid-column
        *ngFor="let col of columns"
        [binding]="col.binding"
        [width]="col.width"
        [allowDragging]="col.allowDragging"
        [cssClass]="col.cssClass"
      ></wj-flex-grid-column>
    </wj-flex-grid>
    

    https://codesandbox.io/s/wijmo-angular-forked-71wy8?file=/src/app/app.component.ts

    Regards

Need extra support?

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

Learn More

Forum Channels