FlexGrid - Restore DataMap not working on special cases

Posted by: eveverad3 on 5 November 2018, 4:43 am EST

    • Post Options:
    • Link

    Posted 5 November 2018, 4:43 am EST

    Hello Team,

    I am working on Angular 2.

    The DataMap shown on the DropDown of a column changes depending on the values of another column.

    Please refer to this example https://stackblitz.com/edit/angular-5fzl7l

    When ID value is changed, the list of Countries that will be shown in the dropdown are only the Countries that have a key smaller than the ID. So if you edit the ID to 1, so only one country. If ID is updated to 2 the dropdown will show only 2 countries etc.

    If then you click on button: save and then restore and redo the actions above you will see that the list of all countries will be shown.

    can you please tell me how to achieve the same behaviour as before even after restoring the data map?

    Thanks and regards

  • Posted 5 November 2018, 4:43 am EST

    2018-11-05_wijmo.zip

    Video showing the steps

  • Posted 6 November 2018, 3:58 am EST

    Hi,

    The issue was because updateCountryMap() method was updating this.countryMap. And when we restore the grid, then ‘this.countryMap’ was no longer bound to the column and a new dataMap is assigned to the ‘Country’ column.

    So we need to update the new DataMap after restoring the column def.

    Please refer to the following updated sample:

    https://stackblitz.com/edit/angular-yz3vxw?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