Posted 4 April 2024, 6:04 pm 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