1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    20
    Vote Rating
    0
    jameyg is on a distinguished road

      0  

    Default [2.0.x][FIXED] Button.ownerCt is undefined for Panel.buttons

    [2.0.x][FIXED] Button.ownerCt is undefined for Panel.buttons


    A button's ownerCt is undefined if added to a Panel using the "buttons" config option or Panel.addButton(). A similar bug exists for tbar and bbar. There's workarounds using class selectors, but this should still be tracked as a bug.

    PHP Code:
    new Ext.Panel({
        
    buttons: [
            {
    text'Submit'handler: function() {alert(this.ownerCt)}}
        ]
    }); 
    From a behavior perspective, I expected the ownerCt to be the Panel itself (since a Panel's footer is conceptually a region of the Panel vs. a child container). This same argument wouldn't apply to the similar tbar, bbar bugs (whose owner is logically the Toolbar).

    For a more practical example of where this is an issue, here's an example of me being lazy w/ handling form submits.
    PHP Code:
    Ext.override(Ext.form.FormPanel, {
        
    addButton: function(cfg,handler,scope) {
            var 
    btn Ext.form.FormPanel.superclass.addButton.apply(thisarguments);
            
    btn.setHandler(function(){ this.ownerCt.getForm().submit());
        }
    }); 

  2. #2
    Sencha - Sales Team dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    738
    Vote Rating
    6
    dawesi will become famous soon enough

      0  

    Default


    bump
    Check out SenchaWorld.com for articles, screencasts, conference videos and more.

    Sencha Technical Training : Asia Pacific Region

    Code Validation : JSLint | JSONLint | JSONPLint

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    6
    jack.slocum is on a distinguished road

      0  

    Default


    Neither of these is a bug, but only because they are not items in an Ext.Container. ownerCt is only set on components specifically declared as items of a Ext.Container.

    However, this has been requested quite a few times and in SVN we have added that both are set. Cheers!
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  4. #4
    Sencha - Sales Team dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    738
    Vote Rating
    6
    dawesi will become famous soon enough

      0  

    Default


    what about creating ownerTb on toolbar buttons and having ownerCt point to the panel the toolbar is in (button/menu/etc could inherit this from their parent)
    Check out SenchaWorld.com for articles, screencasts, conference videos and more.

    Sencha Technical Training : Asia Pacific Region

    Code Validation : JSLint | JSONLint | JSONPLint

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    6
    jack.slocum is on a distinguished road

      0  

    Default


    We only want a single property to maintain. Beyond that cross linking would be a nightmare to maintain across moves etc.

    In 3.0 it's all automated, as Toolbars are Containers.
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  6. #6
    Sencha - Sales Team dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    738
    Vote Rating
    6
    dawesi will become famous soon enough

      0  

    Default


    When would we expect the first alpha test version of Ext 3.0? It says winter 2008... that's two months away here in Australia :-)
    Check out SenchaWorld.com for articles, screencasts, conference videos and more.

    Sencha Technical Training : Asia Pacific Region

    Code Validation : JSLint | JSONLint | JSONPLint

  7. #7
    Ext JS Premium Member
    Join Date
    Nov 2008
    Location
    Warsaw area, Poland
    Posts
    64
    Vote Rating
    1
    nightwatch is on a distinguished road

      0  

    Default Fixed, but not available

    Fixed, but not available


    Hello,

    What's the current status of the problem mentioned here? I'm working with Ext 2.2 and ownerCt is still undefined for toolbar buttons in a panel...
    And what about 3.0 - is it going to be released soon?

    Best regards
    Rafal