Fields formatting (currency, phone number, uppercase, etc.)

1
0
-1

Hi guys,

I would like to add new input types in UIDesigner, but i'm not sure it can be done.

  • Do you know if the input widget can be overriden to add new types ?
  • In order to do so, what would I have to do ?
  • Do I need to create a new Custom wigdet for each input type I want ? And create an angular Directive for each one ?

I have allready tested creating a new custom widget, importing "bcherny/format-as-currency" assets, but i would like to know if it is the right way to do it (that kinda works but is painfull to do for just one type).
Otherwise I could maybe use Angular Material inputs and validators (https://material.angularjs.org/latest/demo/input ) or Bootstrap input-groups (http://getbootstrap.com/components/#input-groups), but it is not really what I'm lloking for :)

If someone can point me the right direction or show me an example it would be very nice !
Cheers

1 answer

1
+1
-1

Hi Pierre,

Let me try to answer your questions:

  • Do you know if the input widget can be overriden to add new types ?

It can't be overriden, but you can create a copy of it. You can access the original code by using something like that: http://localhost:8080/designer/#/en/widget/pbInput

  • In order to do so, what would I have to do ?

It depends what you're trying to achieve. The example of materials and bootstrap looks great to me. Why is it not what you're looking for?

  • Do I need to create a new Custom wigdet for each input type I want ? And create an angular Directive for each one ?

You can make your custom widgets complex enough to handle multiple type. If you look at the widget Input, it uses a 'choice' property that list 4 different types of input supported by the widget (Choices: text, number, email, password). You can do something similar for your custom widget where you provide a list of choice and handle the support of each type in the code of your widget.

Cheers

Testing
Notifications