1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    14
    Vote Rating
    0
    skizzato is on a distinguished road

      0  

    Default FormPanel numberfield : decimal numbers not allowed

    FormPanel numberfield : decimal numbers not allowed


    Hi,
    I've a problem in my formpanel, when I define a field as 'numberfield' it only allows integer numbers on my Android device, but I need to put decimal numbers (float).

    Code here:

    Code:
     Ext.regModel('productAdministrationRecordSet', {
                fields: [
                    {name: 'weight', type: 'float'},
              ................
                    ],
                  
            });
    
    
    
    administrationForm = this.administrationForm = new Ext.form.FormPanel ({
               
                title: AppDelegate.getLocalized("products_administration"),    //Title of tab panel where is form is placed into
    
                scroll: 'vertical',
                items: [ {
                    xtype: 'fieldset',
                    id: 'administrationform',
                    defaults: {
                        xtype: 'textfield',
                        labelAlign: 'left',
                        labelWidth: '30%',
                        required: false,
                        useClearIcon: true,
                        autoCapitalize : false,
                        disabled: true,
                        style: 'font-weight:bold;color:red;text-align:right;',
                    },
                    items:  [
                             {
                                       xtype: 'numberfield',
                                       id: 'weightfield',
                                       name : 'weight',
                                       label: AppDelegate.getLocalized("product_weight"),
                                       placeHolder: 'Weight',
                                       style: 'font-weight:normal;text-align:right;',
                                       decimalPrecision : 2,
                                       forceDecimals : true,
                                       allowDecimals: true,
                                       },
                                   ....................
                               ]
            }],
            });

    On my Android Device appears the number keyboard but no . or , is allowed.

    Please help... thanks.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,217
    Vote Rating
    859
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This is the HTML5 number field at work and is how Android is handling it. We don't do anything special to disallow it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    14
    Vote Rating
    0
    skizzato is on a distinguished road

      0  

    Default


    So it should be an Android issue? Alternatively, can I use a format rule to only allow digits and decimal separator?

Thread Participants: 1