How can I make the KendoMaskedTextBox for Vue bind with v-model against the unmasked value? For example, if my mask is "00000-0000" for a US postal code, and I enter "30157" in the control, it will currently bind "30157-____". I need it to bind as "30157" (no hyphen, and no underscores). I could strip out what I don't want on the server, but it seems like that shouldn't be necessary.
7 Answers, 1 is accepted
0
Hello Michael,
You can use computed property and raw() method of the maskedtextbox, which will return you the value without the mask. The Example below shows such implementation:
https://stackblitz.com/edit/w3zycn-wrqpqy?file=index.html
Hope this would help.
Regards,
Nencho
Progress Telerik
You can use computed property and raw() method of the maskedtextbox, which will return you the value without the mask. The Example below shows such implementation:
https://stackblitz.com/edit/w3zycn-wrqpqy?file=index.html
Hope this would help.
Regards,
Nencho
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 15 Nov 2018, 07:39 PM
Thanks! We're using v-model against a property on an object that came back from a service call. I think ideally, there would just be an option you can specify on kendoMaskedTextbox that tells it whether to bind against the raw value or not. That would have required zero changes in my component, and just a minor change in the template.
0
Accepted
Hello Michael,
I understand your point. That being said, I can suggest you a slight alternative of the previous approach:
https://stackblitz.com/edit/w3zycn-wrqpqy?file=index.html
The above example following the Vue Model Binding and it does require only a specification of the value for the model:
https://www.telerik.com/kendo-vue-ui/components/framework/model-binding/#toc-events
Hope this would help.
Regards,
Nencho
Progress Telerik
I understand your point. That being said, I can suggest you a slight alternative of the previous approach:
https://stackblitz.com/edit/w3zycn-wrqpqy?file=index.html
The above example following the Vue Model Binding and it does require only a specification of the value for the model:
https://www.telerik.com/kendo-vue-ui/components/framework/model-binding/#toc-events
Hope this would help.
Regards,
Nencho
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 19 Nov 2018, 07:21 PM
That does seem to work in conjunction with v-model as well, so we at least have something that works from the view. I think other people are going to need this capability too, and it should just be a simple boolean property to control how it binds, if you're able to log that somewhere. Thanks!
0
Hello Michael,
I have created a Feature Request on your behalf in your brain new Feedback Portal below:
https://feedback.telerik.com/kendo-vue-ui/1362250-add-the-ability-to-implement-model-binding-to-the-raw-value-of-the-maskedtextbox
You can vote for and track the item in the link above.
Regards,
Nencho
Progress Telerik
I have created a Feature Request on your behalf in your brain new Feedback Portal below:
https://feedback.telerik.com/kendo-vue-ui/1362250-add-the-ability-to-implement-model-binding-to-the-raw-value-of-the-maskedtextbox
You can vote for and track the item in the link above.
Regards,
Nencho
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Zerry
Top achievements
Rank 1
answered on 18 Mar 2019, 05:11 AM
[quote]Nencho said:Hello Michael,
I understand your point. That being said, I can suggest you a slight alternative of the previous approach:
The above example following the Vue Model Binding and it does require only a specification of the value for the model:
Hope this would help.
Regards,
Nencho
Progress Telerik
I understand your point. That being said, I can suggest you a slight alternative of the previous approach:
The above example following the Vue Model Binding and it does require only a specification of the value for the model:
Hope this would help.
Regards,
Nencho
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
[/quote]
I think ideally, there would just be an option you can specify on kendoMaskedTextbox that tells it whether to bind against the raw value or not.
0
Hello Michael,
Thanks for the additional specification. Generally, I would suggest you have your comment added to the FeedBack portal as well. I have updated it, though, having your comment added to the specification of the item.
https://feedback.telerik.com/kendo-vue-ui/1362250-add-the-ability-to-implement-model-binding-to-the-raw-value-of-the-maskedtextbox
Thanks for your suggestion!
Regards,
Nencho
Progress Telerik
Thanks for the additional specification. Generally, I would suggest you have your comment added to the FeedBack portal as well. I have updated it, though, having your comment added to the specification of the item.
https://feedback.telerik.com/kendo-vue-ui/1362250-add-the-ability-to-implement-model-binding-to-the-raw-value-of-the-maskedtextbox
Thanks for your suggestion!
Regards,
Nencho
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items