Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    36
    Answers
    1
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default Answered: Is there a way to get numberfield to accept decimal numbers without the leading 0?

    Answered: Is there a way to get numberfield to accept decimal numbers without the leading 0?


    If you type 0.7 in a numberfield it will accept the value, but if you type .7 it will clear it out. Is there a way to get this field to accept the shortened version? Obviously if the user types .7 he means 0.7.


    Example code of it occurring using Sencha Touch 2.1:

    Code:
    Ext.Viewport.add(
    {
       xtype: 'formpanel',
       items:
          [
          {
              id: 'TestField',
             xtype: 'numberfield',
             label: 'Type .7'
          },
          {
              xtype: 'button',
              text: 'Now Click Here',
              handler: function ()
             {
                 Ext.Msg.alert('', 'You entered: ' + Ext.getCmp('TestField').getValue() + '.');
             }
          }
       ]
    });

  2. Using this test:

    Code:
    Ext.Viewport.add({
        items : [
            {
                xtype     : 'numberfield',
                label     : 'Test',
                listeners : {
                    change : function () {
                        console.log('change');
                    }
                }
            }
        ]
    });
    In Chrome on the desktop I get the change and the value is .7. Testing on an ipad, the change event fires but indeed the value is set to 0.7 which is browser behavior as we aren't doing any parsing when you type. If you were to execute setValue then we do a parseFloat or when you execute getValue then we also do a parseFloat.

  3. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    36
    Answers
    1
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default


    Anyone?

    I tried using the change event to listen for it so I can add the 0.7 on the fly, but the event doesn't even fire if you type in ".7". The field just reverts to whatever was in it previously.

  4. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,519
    Answers
    3447
    Vote Rating
    814
    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


    Using this test:

    Code:
    Ext.Viewport.add({
        items : [
            {
                xtype     : 'numberfield',
                label     : 'Test',
                listeners : {
                    change : function () {
                        console.log('change');
                    }
                }
            }
        ]
    });
    In Chrome on the desktop I get the change and the value is .7. Testing on an ipad, the change event fires but indeed the value is set to 0.7 which is browser behavior as we aren't doing any parsing when you type. If you were to execute setValue then we do a parseFloat or when you execute getValue then we also do a parseFloat.
    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.

  5. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    36
    Answers
    1
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default


    It definitely does seem to be a browser specific issue. I was testing on desktop Safari, which I probably should have mentioned, and it doesn't fire the change event and resets the field instantly. Thanks for the reply and helping me understand what was going on.

Thread Participants: 1

Tags for this Thread