Collectionview of undefined in wjgrid in angular 8

Posted by: kunchakuripriyanka9 on 22 July 2020, 2:40 am EST

  • Posted 22 July 2020, 2:40 am EST

    Hi i am migrating from angularJs to angular 9 i am unable to retrieve the data wijmo flexigrid and assign to this.myGrid.collectionview. every time myGrid is coming as undefined. How to implement the grid in angular

    example

    import *as wjcore from @grapecity/wijmo.grid and i used in my component as

    @ViewChild('myGrid ')

    public myGrid : wjcore.FlexGrid;

    so here known is coming undefined, Please help me with the solution

  • Posted 23 July 2020, 3:28 am EST

    Hi,

    There can be a couple of reasons for this issue. Have you declared the myGrid variable on the template side like this?

    <wj-flex-grid #myGrid ...></wj-flex-grid>
    

    If you have already defined it, it only gets initialized in the ngAfterViewInit event. So, if you need to use this variable, use it in the ngAfterViewInit callback of angular 9. If you are using this variable on a button click (or something like this), then it is fine. You do not need to change it.

    Also, can you let me know what exact error is thrown on the console? Is the myGrid variable is undefined or the my.collectionView is undefined? If the collectionView is undefined, then you may not have set the data properly.

    One more thing, only the versions after 5.20193.637 are compatible with angular 9. So, I would suggest you upgrade Wijmo if you are using a lower version than this.

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels