I have searched the forum for a solution to the problem I have and the only similar topic I have found is Mask for cell value but it doesn’t solve my problem
I have several text columns but one and only one of them must have an input mask in this format ‘00.00000.000.00’ (with zero fill; see the examples)
Only allowed characters in this column must be numbers, space and dot; all other characters should be ignored when typing
The goal is that as the user writes, he sees the text in the cell formatted in real-time
Here are two examples (the left side is the sequence of keys typed on the keyboard, the right side is what user should see in the cell while types; note that space and dot key are equivalent)
I’ve read about how I could use the beforeKeyDown event, a custom render (but it seems that formatting only happens on cell exit), RegEx etc… but i have no idea how i can implement the logic
Any tip?
Thanks in advance to anyone who can contribute with an idea/solution
Basing on your requirements I think the best way to achieve that functionality would be to build a custom editor. It would also require to user regex to swap the characters. Using it instead of custom renderer would allow you to change the characters as you type in the cell. Here we have a tutorial on how to build the custom editor that might be useful for you: