Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,407
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default [FIXED] [3.0 Core svn310] Element

    [FIXED] [3.0 Core svn310] Element


    Back to nitpicking (sorry). The fix in v310 for fly elements is to force them into real elements, at which point, why use fly elements at all?

    Code:
        focus : function(defer) {
            var me = this;
            try{
                if(!isNaN(defer)){
                    me.focus.defer(defer, Ext.get(me.dom));
                }else{
                    me.dom.focus();
                }
            }catch(e){}
            return me;
        }
    perhaps would be better as:

    Code:
        focus : function(defer,dom) {
            var me=this;
            dom = dom || me.dom;    
            try{
                if(!isNaN(defer)){
                    me.focus.defer(defer, me,[null,dom]);
                }else{
                    dom.focus();
                }
            }catch(e){}
            return me;
        }
    Though I wouldn't put the new second parameter in the docs...

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,120
    Vote Rating
    508
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Because in some cases it is required, for example without that fix:

    Code:
    Ext.onReady(function(){
        var bd = Ext.getBody();
        
        bd.createChild({
            id: 'text1',
            tag: 'input',
            type: 'text'
        });
        
        bd.createChild({
            id: 'text2',
            tag: 'input',
            type: 'text'
        });
        
        Ext.fly('text1').focus(2000);
        Ext.fly('text2').addClass('foo');
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    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


    just a heads up:
    Code:
    isNaN('') // returns false
    try this instead:
    Code:
    focus: function(defer) {
        var me = this;
        try {
            if (Number(defer)) { // defer > 0
                me.focus.defer(defer, Ext.get(me.dom));
            } else {
                me.dom.focus();
            }
        } catch(e) {}
        return me;
    }

  4. #4
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,407
    Vote Rating
    6
    stever will become famous soon enough stever will become famous soon enough

      0  

    Default


    Quote Originally Posted by evant View Post
    Because in some cases it is required, for example without that fix:
    I didn't say it didn't need to be fixed. Only that it had a side effect of creating a real Element object when it didn't need to. I thought using fly() was a way to avoid that. There are other ways to skin this cat, and I posted one, another would be to use a private deferfocus fn, and others out there I'm sure.

    I'm just not a fan of having unintended side effects. In your example, the user had two calls to fly (and not get so they didn't want the creation of new Element objects), yet one got created.

    I did preface the post with an apology for nitpicking!

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,120
    Vote Rating
    508
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Modified to appease the nitpickers along with a few others.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 2

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