1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    1
    Vote Rating
    0
    nickcen is on a distinguished road

      0  

    Default NumberField bug in Air 1.5

    NumberField bug in Air 1.5


    We can not input decimal point in NumberField under Air 1.5.

    I think it is caused by the following code from the NumberField
    Code:
    initEvents : function(){
            Ext.form.NumberField.superclass.initEvents.call(this);
            var allowed = this.baseChars+'';
            if(this.allowDecimals){
                allowed += this.decimalSeparator;
            }
            if(this.allowNegative){
                allowed += "-";
            }
            this.stripCharsRe = new RegExp('[^'+allowed+']', 'gi');
            var keyPress = function(e){
                var k = e.getKey();
                
                if(!Ext.isIE && (e.isSpecialKey() || k == e.BACKSPACE || k == e.DELETE)){
                    return;
                }
                var c = e.getCharCode();
                
                if(allowed.indexOf(String.fromCharCode(c)) === -1){
                    e.stopEvent();
                }
            };
            this.el.on("keypress", keyPress, this);
    }
    when pressing the decimal point key under FF/IE/Chrome, the getKey() method return 46 and it is consider to be a special key. But when in Air , the getKey() method return 190 which is not considered as a special key and the String.fromCharCode(c) method return a value '3/4' which is not equal to '.'.

    I have make a dirty hack like this which can by pass this problem.
    Code:
    if(!Ext.isIE && (e.isSpecialKey() || k == e.BACKSPACE || k == e.DELETE || (Ext.isAir && k == 190) )){
                    return;
                }

  2. #2
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    you're running on an older 2.2x version of the library which contains the problem you described.
    this issue was specifically addressed in 2.3.0. grab a copy of that and try your test case again.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar