1. #1
    Ext User
    Join Date
    Feb 2010
    Posts
    6
    Vote Rating
    0
    kenwood is on a distinguished road

      0  

    Default Customize NumberField to allow commas

    Customize NumberField to allow commas


    I have been looking at the documentation for Ext.form.NumberField but couldn't find a setting to allow commas (e.g. 1,000,000) to be inputted to the field. Is there an example field somewhere that I can leverage from?

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,681
    Vote Rating
    112
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    the numberField is designed to only allow float-values (it uses parseFloat() internally) so you will have to rewrite parts of it. i even wrote an ux for leading-zeroes -> phone numbers.

    in your case, it could make sense to use a textField with validating regex and input limitations (look in the sourceCode for numberField for details).

    kind regards,
    tobiu
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    1
    Vote Rating
    0
    dsa is on a distinguished road

      0  

    Default


    baseChars: "0123456789,." will do the job in Ext 4

Thread Participants: 2