TreeList Data Validation
Environment
Product Version | v7.2.3 |
Product | Progress® KendoReact |
Description
I want to validate that data entered through the TreeList, whether it is newly added or modified through editing.
Solution
In order to add validation to the cell that is being edited, render a custom edit cell component (using the editCell
prop) and handle the validation based on your requirement.
The example below demonstrates this approach where the variable isValid
is set to false
when the input length is less or equal to 4. Based on its value, the valid
prop of the KendoReact Input component is set and shows a validation message. In addition, in the save
function, the state is set only when isValid
is set to true:
The above demo uses inline-editing that is explained in the below article. However, you can use any other editing approach.