Accessing the original value of value within an editor validator
Accessing the original value of value within an editor validator
We have a use case where I need to retrieve the original (numeric) value of an editor field for validation purposes.
The changed value of the value must be in the range 0..<original value>. So I need to get hold of the original value of
particular editor cell?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm not quite sure what you mean I'm afraid. The data submitted to the server should be numeric and not formatted into something else (unless you have a formatter on it of some sort?).
Allan
See
https://s.nimbus.everhelper.me/share/1232540/l91mp5yz9ykxzrw4qh0v
This row has a current value of "10" (L).
The user is able to edit this row:
https://s.nimbus.everhelper.me/share/1232545/ith3n0voa3vu5zanslaf
The user can enter arbitrary values (I already have a validator). The validator must in this case validate the value for being greater of equal to zero and the value must be less or equal the current value to 10.
Attach a function to the editor
open
event that makes a copy of the original value in the field. Then on thepreSubmit
you can compare the current value to the original.