Results 1 to 2 of 2

Thread: Sencha touch 2.2.1 numberfield allows all characters

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    40
    Answers
    1

    Default Sencha touch 2.2.1 numberfield allows all characters

    Hello everybody, I'm trying to use the numberfield type in my application but this field accepts all the carachters and in iOS 7+ it show the default keyboard and not the numberkeyboard. I've partially solved using this xtype
    PHP Code:
    Ext.define('Dynamo.field.PatternText', {    extend 'Ext.field.Text',
        
    xtype  'patterntextfield',


        
    config : {
            
    pattern '[0-9]*'
        
    },


        
    updatePattern : function(pattern) {
            var 
    component this.getComponent();


            
    component.updateFieldAttribute('pattern'pattern);
        },


        
    initialize : function() { 
            
    this.callParent();


            var 
    component this.getComponent();


            
    component.input.on({
                
    scope   this,
                
    keydown 'onKeyDown'
            
    });
        },


        
    onKeyDown : function(e) {
            var 
    code e.browserEvent.keyCode;


            if (!(
    code >= 48 && code <= 57) && !(code >= 97 && code <= 105) && code !== 46 && code !== && code !== 188 && code != 190) {
                
    e.stopEvent();
            }
        }
    }); 
    This code shows a only number keyboard but there's no possiblity to use floating numbers. How can I solve this problem?

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    Hi--,

    Take a look at this thread, it seems relevant to what you're after:

    https://www.sencha.com/forum/showthr...-numeric-input


    Regards,
    Bryan

Similar Threads

  1. [FIXED] Numberfield masked characters
    By brocktopia in forum Ext 5: Bugs
    Replies: 2
    Last Post: 23 Jun 2015, 2:27 PM
  2. [OPEN] Sencha Touch + Phonegap + Non-latin characters in app name
    By Ola GP in forum Sencha Cmd
    Replies: 1
    Last Post: 31 Jan 2014, 2:27 PM
  3. Replies: 0
    Last Post: 20 Jan 2013, 9:03 AM
  4. Replies: 2
    Last Post: 14 May 2012, 7:51 AM
  5. maxLength attribute for numberfield is not working in sencha touch 1.1
    By hannan khan in forum Sencha Touch 1.x: Q&A
    Replies: 1
    Last Post: 8 Mar 2012, 2:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •