wjFlexGridDetail grid breaks with error Cannot read properties of undefined

Posted by: muddam.kranthi on 15 September 2022, 4:14 pm EST

  • Posted 15 September 2022, 4:14 pm EST

    Hi Team,

    I have a wjFlexGridDetail grid as below.

    <wj-flex-grid #flexGrid class=“bento-flex-grid has-row-hover mt-4”

    [(itemsSource)]=“gridDataSource”

    [isReadOnly]=“true” [stickyHeaders]=“true” [showSort]=“true”

    [selectionMode]=“‘Row’”

    (initialized)=“gridInitialized(flexGrid)”

    [itemFormatter]=“itemFormatter”

    [headersVisibility]=“‘Column’” [ngStyle]=“{‘height’: CalculateHeight()}”

    [bentoBusyLoader]=“gridLoader”>

                    <ng-template wjFlexGridDetail #dp="wjFlexGridDetail" 
                        [detailVisibilityMode]="'Code'" let-row="row"
                        let-item="item">
                   </ng-template>
    

    I have a dropdown above the grid and on chnage od the dropdown value, the grid data updates.

    the grid breaks with the below error in console for angular

    an error occurred here broo TypeError: Cannot read properties of undefined (reading ‘dataItem’)

    at FlexGridDetailProvider.getDetailRow (es5-esm.js:14:5821)

    at FlexGridDetailProvider.isDetailVisible (es5-esm.js:14:6013)

    at AccrualsComponent_div_3_div_16_ng_template_7_Template (accruals.component.html:526:33)

    at executeTemplate (core.js:9614:9)

    at refreshView (core.js:9480:13)

    at refreshEmbeddedViews (core.js:10605:17)

    at refreshView (core.js:9504:9)

    at refreshEmbeddedViews (core.js:10605:17)

    at refreshView (core.js:9504:9)

    at refreshEmbeddedViews (core.js:10605:17)

    It is breaking at the html:

    <wj-flex-grid-column is-read-only=“true” [width]=“40”>

    <ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” let-

    row=“row” let-item=“item”>

    <i class=“grid-action-icon”

    [ngClass]=“{‘bento-icon-expand’:!dp.isDetailVisible(row),‘bento-

    icon-collapse’:dp.isDetailVisible(row)}”

    (click)=“toggleDetail(row, dp, item)”>



  • Posted 18 September 2022, 11:03 pm EST

    Hello,

    Sorry but we are unable to replicate the issue at our end, could you please refer to the below sample used to replicate the issue and let us know if any changes are required to replicate the issue at our end?

    If you are facing the issue only in your application and not in the below-shared sample, it might be possible that the issue is caused due to some other factors in your application therefore I would request you to please share a small sample replicating the issue so that we can investigate the root cause and assist you accordingly.

    Sample link: https://stackblitz.com/edit/angular-mewuqn?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.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