Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    98
    Vote Rating
    5
    plleeuwm is on a distinguished road

      0  

    Default [4.1] Component.showAt does not fire the beforeshow event the first time it is shown.

    [4.1] Component.showAt does not fire the beforeshow event the first time it is shown.


    REQUIRED INFORMATION




    Ext version tested:
    • Ext 4.1.0
    Browser versions tested against:
    • IE8
    • FF3 (firebug 1.3.0.10 installed)
    • Safari 4

    Description:


    Component.showAt does not fire the beforeshow event the first time it is shown.

    Code:
    show: function(animateTarget, cb, scope) {
            var me = this,
                rendered = me.rendered;
    
            //this is true on the first showAt
            if (rendered && me.isVisible()) {
                if (me.toFrontOnShow && me.floating) {
                    me.toFront();
                }
            } else if (me.fireEvent('beforeshow', me) !== false) {
                // Render on first show if there is an autoRender config, or if this is a floater (Window, Menu, BoundList etc).
                me.hidden = false;
                if (!rendered && (me.autoRender || me.floating)) {
                    me.doAutoRender();
                    rendered = me.rendered;
                }
                
                if (rendered) {
                    me.beforeShow();
                    me.onShow.apply(me, arguments);
                    me.afterShow.apply(me, arguments);
                }
            }
            return me;
        }
    Test Case:
    Code:
    component.showAt(0,0);

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,050
    Vote Rating
    657
    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


    We already have a report of this particular issue, should be fixed for 4.1.1. Thanks.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    98
    Vote Rating
    5
    plleeuwm is on a distinguished road

      0  

    Default


    This still doesn't work in 4.2.*

    Code:
    var comp = new Ext.Component({renderTo:Ext.getBody()});
    comp.on('beforeshow', function(){
        console.log('aye')
    })
    comp.showAt(0,0);
    Check out my small framework https://github.com/pllee/luc . I would love to get some feedback on it let me know what you think about it in a pm.

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,050
    Vote Rating
    657
    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


    In that test case it's already visible, so it's not going to fire before/show.

    Code:
    Ext.require('*');
    
    Ext.onReady(function() {
        var comp = new Ext.Component({
            html: 'Foo',
            autoRender: true
        });
        comp.on('beforeshow', function() {
            console.log('aye')
        });
        comp.showAt(0, 0);
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2010
    Posts
    98
    Vote Rating
    5
    plleeuwm is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    In that test case it's already visible, so it's not going to fire before/show.

    Code:
    Ext.require('*');
    
    Ext.onReady(function() {
        var comp = new Ext.Component({
            html: 'Foo',
            autoRender: true
        });
        comp.on('beforeshow', function() {
            console.log('aye')
        });
        comp.showAt(0, 0);
    });
    You are correct, thanks for clarifying this.
    Check out my small framework https://github.com/pllee/luc . I would love to get some feedback on it let me know what you think about it in a pm.

Thread Participants: 1