Results 1 to 7 of 7

Thread: [FIXED-41] Container & Toolbar onRender/afterRender split of rendering is wrong

    You found a bug! We've classified it as a bug in our system. We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default [TENT-41] Container & Toolbar onRender/afterRender split of rendering is wrong

    The fix here has caused some other problems:
    http://extjs.com/forum/showthread.ph...200#post370200

    Problems with the doLayout of Windows on show laying out toolbars who's layout property is still a String.

    There's something screwy about the order of this stuff. There's a lot of calls do doLayout which probably should not be there. It will take some investigation.

    Oh, I think the problem is because Toolbar doesn't call it's superclass's onRender method!

    One problem is Toolbar's non-adherence to standards

    Toolbar.onRender should create the autoEl specification needed, and leave the regular rendering machinery to do the rest:

    Code:
    Ext.override(Ext.Toolbar, {
        onRender : function(ct, position){
            if(!this.el){
                this.autoEl = this.autoCreate || {
                    cls: this.toolbarCls + ' x-small-editor'
                };
            }
            Ext.Toolbar.superclass.onRender.apply(this, arguments);
        }
    });
    I don't think it's a problem with Window, I think it could be FormlLayout???

    But run examples/form/anchoring.html

    The anchoring of the textarea to the boundaries no longer works
    Last edited by mjlecomte; 7 Aug 2009 at 4:51 PM. Reason: consolidation

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    481

    Default [OPEN] onRender/afterRender split of rendering is wrong

    I just got the latest version from SVN. The original problem is fixed, but as Animal said, other problems arose. Everytime any toolbar is added to a container, an exception is thrown from Container's doLayout() method.
    Code:
    this.layout.layout is not a function
    this.layout.layout();
    This is true with regard to any toolbar - top, bottom, paging toolbar...

    To reproduce it you can just add a tbar, bbar or fbar config to anything in the code from the first post.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Quote Originally Posted by elishnevsky View Post
    I just got the latest version from SVN. The original problem is fixed, but as Animal said, other problems arose. Everytime any toolbar is added to a container, an exception is thrown from Container's doLayout() method.
    Code:
    this.layout.layout is not a function
    this.layout.layout();
    This is true with regard to any toolbar - top, bottom, paging toolbar...

    To reproduce it you can just add a tbar, bbar or fbar config to anything in the code from the first post.
    See above for a fix on that.

    Also, the onRender/afterRender split of rendering was wrong.

    To replicate the original behaviour (which performed all of it's Container setting up after calling superclass's render), we should just put everything in an afterRender method:

    It should be

    Code:
        // private
        afterRender : function(){
            Ext.Container.superclass.afterRender.apply(this, arguments);
            if(this.layout){
                if(Ext.isObject(this.layout) && !this.layout.layout){
                    this.layoutConfig = this.layout;
                    this.layout = this.layoutConfig.type;
                }
                if(Ext.isString(this.layout)){
                    this.layout = new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig);
                }
                this.setLayout(this.layout);
            }        
    
            if(this.activeItem !== undefined){
                var item = this.activeItem;
                delete this.activeItem;
                this.layout.setActiveItem(item);
            }
            if(!this.ownerCt){
                // force a layout if no ownerCt is set
                this.doLayout(false, true);
            }
            if(this.monitorResize === true){
                Ext.EventManager.onWindowResize(this.doLayout, this, [false]);
            }
        },

  4. #4
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    481

    Default

    Yes, I applied your override for Toolbar and it fixed the prob. Thanks.
    Nige, you should be given write access to SVN

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    That would be dangerous. I'm always in too much of a hurry!

  6. #6
    Ext JS Premium Member stever's Avatar
    Join Date
    Mar 2007
    Posts
    1,408

    Default

    As a reference for a simple test case of this bug, just use this example from source:

    examples/window/hello.html

  7. #7
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,239

    Default

    This is fixed in SVN r5004.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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