Trigger Formatter to update a field? #80

Open
Enchiridion opened this Issue May 6, 2015 · 2 comments

Projects

None yet

3 participants

Hi,
How can I trigger formatter to update the contents of a field programmatically?

I'm asking because I'm using formatter to display a phone number as (xxx) xxx-xxxx, however it's stored in the database as xxxxxxxxxx. So after a form is saved and reloaded, the value in the field displays as xxxxxxxxxx. I want to tell formatter to immediately update the field so it looks like (xxx) xxx-xxxx again.

The only public function that I could get to trigger an update was .resetPattern(), but it fails when I pass it an array of patterns. Haven't had any luck with the 'private' methods, and I'd rather not use those if possible.

I'm using v0.1.5.

Thanks!

thiagog3 commented Aug 5, 2015

+1

Jeff-P commented Mar 2, 2016

after your pattern you need to add'persistent': true and when you load data automatically on the input it will auto format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment