FlexGrid column.visible=false, item.prop=undefined and CollectionView.getError

Posted by: steidle on 31 December 2023, 8:40 pm EST

    • Post Options:
    • Link

    Posted 31 December 2023, 8:40 pm EST - Updated 31 December 2023, 11:38 pm EST

    I just updated to Wijmo v20232 and the selection on my FlexGrids has stopped working.

    I managed to narrow the problem down to this combination, which no longer works:

    • column.visible=false
    • item.property undefined
    • CollectionView.getError function defined (returning null == no error)

    Older version of Wijmo where the above combination works:

    https://stackblitz.com/edit/ng11-wj20213-grid-colinvis-noval-geterror

    (Still worked on 20221 or 20222, sorry I do not remember what version I had before)

    Not working on latest version:

    https://stackblitz.com/edit/wj20232-flexgrid-col-invisible-noval

    I have defined the order and editing behavior of my columns in JS code and only a few of them are visible initially. Things like type or if an column is required is set when a column really gets used and is loaded from the database. So I would want to avoid having to specify dataType or isRequired on all my columns (which solves the problem).

    Has something changed in your code running before CollectionView.getError ? Value coercion on dataType Object?

    Edit: I just went through your ChangeLog.txt of 5.20232.939 and noticed this might be related to WJM-26326 fixed in 5.20231.900. Going back to build 5.20231.888 is unfortunately not an option as I have also already updated to Angular16.

  • Posted 1 January 2024, 10:57 pm EST

    Hi,

    Thank you for sharing a working sample. In my investigation, I have observed that the issue occurs for PureJS. Since, you are defining Flexgrid in PureJs way so it is causing the observed behavior. This is happening because the default dataType of “City” column is set to “Object”. This causes the validation of cells present in that column. This was not done in previous versions. I have escalated this to the development team for further investigation. Please note the internal tracking id of the issue for further communication on the issue: WJM-32997

    Meanwhile, as a workaround,

    If there is any specific use case of defining FlexGrid in ngOnInit() then please let us know.

    Thank you for your understanding.

    Regards

  • Posted 4 January 2024, 6:35 am EST - Updated 4 January 2024, 6:41 am EST

    Hi

    Thanks for your answer and escalating the issue. I noticed on other columns that they have type Object while the type is not set. But not sure why one would want to validate an undefined value that is neither visible nor explicitly required…

    I am extending FlexGrid to a PersonGrid which is used in multiple places. The scaffolding of the PersonGrid will have to work with different sets of columns for different use cases. I know I can derive from WjFlexGrid, too, but for know I enjoy the greater flexibility of pureJS. Just easier to juggle with arrays of columns :slight_smile: .

    So I went with you second solution, which indeed fixes the problem.

    There is no specific reason I am initializing FlexGrid in ngOnInit(). Could this be problematic?

    Where can I follow what happens with WJM-32997? Will I get a notice?

  • Posted 4 January 2024, 5:50 pm EST - Updated 4 January 2024, 6:27 pm EST

    [deleted - related symptom / console warning, but managed to solve it on my side]

  • Posted 4 January 2024, 8:18 pm EST

    Hi,

    Thank you for notifying me that the second solution was helpful to you.

    There is no known issue in creating FlexGrid in ngOnInit() using pureJS but, it is recommended to use the Angular markup syntax (as described here: https://developer.mescius.com/wijmo/docs/GettingStarted/Angular-Components#angular-markup-syntax).

    Related to “Where can I follow what happens with WJM-32997? Will I get a notice?”, currently the issue is with DEV team. I will update you as soon as I get any update from the DEV team. Meanwhile, you may use this id(WJM-32997) to ask for the updates in case it gets delayed.

    Thank you.

    Regards

  • Posted 26 April 2024, 9:14 pm EST

    Any news on a fix for WJM-32997 ?

  • Posted 29 April 2024, 4:22 pm EST

    Hi Steidle,

    The dev team is still working on this, we have asked them to prioritize this issue. We will update you when we have more information from the dev team.

    Regards

Need extra support?

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

Learn More

Forum Channels