Results 1 to 7 of 7

Thread: Numberfield with decimal values

  1. #1
    Sencha User
    Join Date
    Sep 2013
    Posts
    25

    Default Answered: Numberfield with decimal values

    Sencha Version: 2.2 - iPod Touch 4'th Gen

    To enter the weight value we have used numberfield. And also set the numeric keyboard using the pattern. But keyboard doesn't have any dot to enter in decimal precision. It gives only digit 0 to 9.

    Code:
    xtype: 'numberfield',                            
    name: 'Weight',
    label: 'Weight',
    id: 'weightfield',
    listeners: {
      initialize: function(){
         var nfield = Ext.get('weightfield');
         nfield.down('input').set({pattern:'[0-9]*'});
      }
    }
    Please suggest how to enter the decimal value using the number keyboard? Is there an alternate way to achieve this? i.e How to enter the weight with decimal values using numeric keyboard?
    Last edited by neethul; 5 Oct 2013 at 3:18 AM. Reason: Formatted the code

  2. I know this is annoying, that's why I am suggesting to take a look at this custom component:
    Numpad
    I did some minor changes to it (as destroying the numpad, when hiding...).
    But overall this is a really good starting point.

  3. #2
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    597
    Answers
    35

    Default

    I know this is annoying, that's why I am suggesting to take a look at this custom component:
    Numpad
    I did some minor changes to it (as destroying the numpad, when hiding...).
    But overall this is a really good starting point.
    • Kurt001

    Code Review | Send PM


    Need to include a test case use:
    https://fiddle.sencha.com/#home

  4. #3
    Sencha User
    Join Date
    Sep 2013
    Posts
    25

    Default

    I tried this, it comes out well on iPod Touch and Android.
    By default is there any support from Sencha for the decimal precision without using Custom component?

  5. #4
    Sencha User
    Join Date
    May 2012
    Location
    Colombia
    Posts
    46
    Answers
    2

    Default

    I had the same problem on samsung galaxy s4 and after trying everything opted to use that component.

  6. #5
    Sencha User
    Join Date
    Sep 2013
    Posts
    25

    Default

    Thanks. Any licensing implication? This can be used for commercial/customer application?

  7. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    448
    Answers
    5

    Default

    Are you sure this is a Sencha issue? I think they're just showing the standard <input type="number> field. It's up to the browser and OS to decide what kind of keyboard to show. I've noticed that there are some non-standard Android keyboards that don't include a decimal point.

  8. #7
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    597
    Answers
    35

    Default

    A while back I looked into this problem. It's not even that all Android devices behave the same way. It's always different and you never know what will show up. Sometimes you even get next/previous buttons, somtimes there is a numberfield for only a single number and then it switches back to letters.
    Some take the layout you tell them to use, some not.
    Same goes for iOS, and some say it's even worse
    • Kurt001

    Code Review | Send PM


    Need to include a test case use:
    https://fiddle.sencha.com/#home

Tags for this Thread

Posting Permissions

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