1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    47
    Vote Rating
    0
    gald is on a distinguished road

      0  

    Default Form, pourcent field ?

    Form, pourcent field ?


    in a form, how to create a pourcent field ?
    which is just un number field with a "%" at the end of the number ??

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,717
    Vote Rating
    107
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    You can for example check after each keyup if the value contains a % at the end and if not, you add it to there.

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    47
    Vote Rating
    0
    gald is on a distinguished road

      0  

    Default


    well, ok, i'm going to try this.
    But a don't understand exactly the goal of the NumberFormat which we can set to NumberField.
    beacause the numberFormat is not used to format the displayed number value

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,717
    Vote Rating
    107
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    Its to validate the input value or to set the input value if you call setValue. It does not validate input you enter with your keyboard. With validate i mean, that its used to parse it to get a correct Number object or to transform the Number into a correct String.

  5. #5
    Sencha User
    Join Date
    Feb 2008
    Posts
    47
    Vote Rating
    0
    gald is on a distinguished road

      0  

    Default


    ok thanks for your quick answer

  6. #6
    Sencha User
    Join Date
    Feb 2008
    Posts
    47
    Vote Rating
    0
    gald is on a distinguished road

      0  

    Default


    I can't make it work.
    I manage to just add a "%" at the end.
    But the value is not validated so the red underline appear.
    If i a use a numberFormat to allow the pourcent, weird thing appends...

  7. #7
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,717
    Vote Rating
    107
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    You should post your code in a small, standalone testcase. Maybe someone can help you with it.

Similar Threads

  1. Ext.form.Field override : Adding an icon to a form field of any type
    By arnold in forum Ext 2.x: User Extensions and Plugins
    Replies: 2
    Last Post: 25 Mar 2011, 6:41 AM
  2. Replies: 5
    Last Post: 24 Jan 2010, 10:06 PM
  3. Form Validation when one field is dependent on another form field
    By lazyProgrammer in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 6 Oct 2008, 3:49 AM
  4. How to add a file field like field to an Ext form
    By soltan13 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 1 Jul 2007, 3:48 AM