dynamic fields to bind table names and columns to table columns

Hello,

I am trying to bind the tables to fields in e-columns with *ngFor. But I am getting the "Can't bind to 'ngForFor' since it isn't a known property of" error. I appreciate if you can let me know how I can bind my schema with tables and fields to querybuilder.


  <ejs-querybuilder id="querybuilder" #querybuilder width="100%" [rule]="importRules" enableNotCondition=true
    separator='.'>
    <e-columns *ngFor = "let table for tablesList">
      <e-column field="{{table}}" [columns]="{{columns[table]}}" (select)="onSelect($event)"
      (ruleChange)="updateRule($event)"
      ></e-column>
    </e-columns>
  </ejs-querybuilder>


Thank You,

KS



3 Replies

TS Thaneegairaj Sankar Syncfusion Team April 29, 2022 02:21 PM UTC

Hi Kal,


We have prepared a sample based on requirement. Please find the below code example and sample link,


Sample: https://stackblitz.com/edit/angular-59nuhv-utumaa?file=app.component.html


<ejs-querybuilder #querybuilder class="row" [dataSource]="dataSource" (created)="createdControl()">

    <e-columns>

      <ng-container *ngFor="let column of Column">

        <e-column [field]="column?.field" [type]="column?.type" [label]="column?.label" [autoFit]="true">

        </e-column>

      </ng-container>

    </e-columns>

  </ejs-querybuilder>


Please get back to us, if you need any further assistance on this.


Regards,

Thaneegairaj S



KS Kal Sir April 29, 2022 03:44 PM UTC

Thank you. This is very helpful.



YA YuvanShankar Arunagiri Syncfusion Team May 2, 2022 04:48 AM UTC

Hi Kal,


We are happy to hear that your requirement has been fulfilled. Please get back to us if you need any further assistance on this.


Regards,

YuvanShankar A


Loader.
Up arrow icon