Add CellProperties as a parameter to validator function #10487
john-swallow-cenduit
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Thank you for pointing that out. We understand that the current workaround is not very convenient. I agree that this is something we should consider fixing in the future. Our roadmap is already planned, but I propose your request to our development team for the estimation. Additionally, can you please confirm if this #7965 case is related to the same matter? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using HoT in an Angular component the passing of the details of the cell being validated by scope only is limiting and working around it is a pain. In a usage scenario where a validator wants to make a decision based on data not present to the HoT instance itself you need to be able to access both "this" as the CellProperties but also "this" as the scope of the Component in which the HoT instance is being hosted - and it isn't straightforward to do both.
It would just be easier if the validator passed the CellProperties as a parameter in the first place. Instead of:
validator(value, callback) { // "this" is the CellProps }
This:
validator(value, callback, cellProperties: CellProperties) { // "this" is still the CellProps }
Then I could use an arrow function to keep my component level scope and yet still access the CellProps.
validator(value, callback, cellProperties: CellProperties) => { // "this" is the component but now I can access CellProps }
Take this as for instance:
You can work around this by the usual "const self = this;" trick but its just a pain to have to do this:
Beta Was this translation helpful? Give feedback.
All reactions