Assertion failed in Wijmo: This collection must contain PivotField objects only

Posted by: subakaranmca on 21 November 2018, 4:42 am EST

    • Post Options:
    • Link

    Posted 21 November 2018, 4:42 am EST

    TS:

    
    
    var ng = this.thePivotPanel.engine
    ng.rowFields.push('Country');
    ng.valueFields.push('CQ_WK1');
    
    

    if I don’t add the above two line then no error but grid is not loaded as there is no rofields and values fields

    HTML

    
    <div class="mdl-cell mdl-cell--4-col">
                    <wj-pivot-panel
                            #thePanel
                            [itemsSource]="rawData">
                    </wj-pivot-panel>
                </div>
                <div class="mdl-cell mdl-cell--8-col">
                    <wj-pivot-grid
                            #pivotGrid
                            [itemsSource]="thePivotPanel"
                            [showSelectedHeaders]="'All'">
                    </wj-pivot-grid>
                </div>
    
  • Posted 22 November 2018, 1:18 am EST

    It looks like one of the fields with the specified name(‘Country’ or ‘CQ_WK1’) doesn’t exist on PivotEngine(ng instance).

    Please make sure that the fields with the specified name exists.

    let downloadsField = ng.fields.getField('Downloads');
        if(downloadsField){
          // downloads field exists, push to the collection
          ng.valueFields.push(downloadsField);
        }
    

    If you are still facing issue then please modify the following sample so that it replicates the issue:

    https://stackblitz.com/edit/angular-vknrlx?file=app%2Fapp.component.ts

    ~Sharad

Need extra support?

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

Learn More

Forum Channels