Dynamic column collection filtering

Posted by: srish123ti on 31 May 2021, 3:13 am EST

    • Post Options:
    • Link

    Posted 31 May 2021, 3:13 am EST

    Hi,

    I’m trying to filter data based on previous column cell selection value. For which I’ve followed the below snippet.

    https://stackblitz.com/edit/js-yv2psm?file=index.js

    In my case, I have data available and used above snippet solution to achieve the mentioned functionality but it is not working for my case.

    For example - in my case ,On selection of section, I am trying to change the subjects collection with its preselected value.

    Below is my snippet.

    https://stackblitz.com/edit/angular-fnxrad?file=src/app/app.component.ts

    Please help me with the solution.

    Thank You.

  • Posted 2 June 2021, 12:26 am EST

    Hi Shristi,

    There are few issues in your code:

    1. You have initialized a grid in the this variable, so the FlexGrid is unable to find the hostElement. To resolve this issue you can handle the grid initialization inside a method like ngOnInit(),ngAfterViewInit()… etc.

    2. The data source you have provided to the grid cannot be used for the DataMap because dataMap works on key-value pair, for every key(id) the corresponding value is shown on the grid cell with dropdown. In the data you haven’t provided any id or key, therefore, it is throwing an error. Please refer to the sample below in which I have updated the data (dataSource) accordingly:

    Sample: https://stackblitz.com/edit/js-1cenqs?file=index.js

    If you wish to implement dynamic data maps in angular I would recommend you to refer wijmo angular demo sample of dynamic data maps.

    Demo sample: https://www.grapecity.com/wijmo/demos/Grid/Columns/DynamicDataMaps/angular

    Let us know if you need any further assistance.

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels