Revert to previous value of cell in wijmo grid

Posted by: sdayal on 6 August 2021, 7:14 am EST

  • Posted 6 August 2021, 7:14 am EST

    Hi team,

    We have a requirement where if a value is present on the cell which is not a part of the dropdown (collectionView) then if I click on the dropdown of the cell, the value will get cleared. Now if nothing is selected from the dropdown then the cell should revert back to it’s original value.

    Example:-

    1. In the below snippet, Click on 2nd row subjects column with value as ‘French and Russia’.
    2. Since ‘French and Russia’ is not part of the 2nd row subjects cell dropdown it’s value is getting cleared using the method ‘isDropdownChanged’. (Refer lines : - 145 - 164).
    3. But Now, If I don’t select anything from the dropdown and click anywhere outside that cell then it’s value should be reverted to its original value i.e. French and Russia
    4. Also the subsubjects column is dependent on the subjects column so it is also getting cleared, So it should also be reverted back to it’s original value(i.e. before getting cleared).

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

    How can we achieve this functionality ?

    Regards

  • Posted 8 August 2021, 10:35 pm EST

    Hi team,

    Can you help us with the solution.

    regards

  • Posted 9 August 2021, 11:47 pm EST

    Hi team,

    Can you please help us with the solution.

    Regards

  • Posted 10 August 2021, 12:05 am EST

    Hello,

    Kindly refer to the following points for the resolution of the above query:

    We may store the value of subjects and Subsubjects column in a local variable before removing the value from the dataItem in isDroppedDownChanged event of MultiSelect.

    We may use the lostFocus event of the MultiSelect and may check if the dataItem is still empty, we may restore the given values from the local variable.

    Please refer to the sample below:

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