CollectionView.getError Breaking Change (version 5.20241.9)

Posted by: amakarenko on 4 April 2024, 9:04 am EST

  • Posted 4 April 2024, 9:04 am EST

    https://jscodemine.mescius.io/sample/cpFHtu9GXkaaigpvSLkhfQ/

    Test case 1:

    • Have a grid with a column that omits type or isRequired definition
    • Have a data payload with values equal null in this column
    • Enable CollectionView.getError
    • Result: the cells are highlighted erroneous, with a message “Please fill out this field.”
    • Expected: no validation to be enforced for this column (this was behavior in previous versions)

    Test case 2:

    • Based on Test case 1 source code
    • Edit source code and add isReadOnly: true property to the grid initialization
    • The cells are still highlighted as erroneous, but now they are not editable
    • Select one of the erroneous cells (e.g. on the row 1), then select another cell in the same column (e.g. row 2)
    • Result: the grid starts uncontrollably flickering, appearing to be jumping around between selection of erroneous cells. This seizes up user interface and makes impossible to do anything

    Notes:

    This code example is forked from the example published on the Demos website: https://developer.mescius.com/wijmo/demos/Grid/Editing/CollectionViewValidation/purejs

    In my fork, I short-circuited the getError() function so it always returns null (e.g. no error). The described issues disappear, if we simply delete the getError from collection view definition.

    According to documentation, when column definition dataType is omitted, it defaults to DataType.Object (0) - it should not enforce any validation.

    Also why is the validation enforced only when CollectionView.getError is present?

    I was able to work around it by setting isRequired: false in the column definition. The problem is that we have a portfolio of existing apps that would break if updated to version 5.20241.9

  • Posted 5 April 2024, 12:07 am EST

    Hi,

    We have forwarded this issue to the dev team for further investigation with internal tracking ID - WJM-33692. For now, please use the workaround that you shared, i.e. to set the ‘isRequired’ property of the Column to false.

    We will update you as soon as we have some updates 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