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

    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 User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default

    bump
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    18
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      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
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  4. #4
    Sencha User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      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)
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  5. #5
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956
    Vote Rating
    18
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      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
    Sencha Co-Founder, Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum

  6. #6
    Sencha User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      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 :-)
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  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

    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