PDA

View Full Version : FormPanel numberfield : decimal numbers not allowed



skizzato
17 Feb 2012, 3:10 AM
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:



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.

mitchellsimoens
17 Feb 2012, 5:10 AM
This is the HTML5 number field at work and is how Android is handling it. We don't do anything special to disallow it.

skizzato
17 Feb 2012, 5:12 PM
So it should be an Android issue? Alternatively, can I use a format rule to only allow digits and decimal separator?