-
7 Feb 2008 9:10 AM #1
[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.
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).PHP Code:new Ext.Panel({
buttons: [
{text: 'Submit', handler: function() {alert(this.ownerCt)}}
]
});
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(this, arguments);
btn.setHandler(function(){ this.ownerCt.getForm().submit());
}
});
-
26 Mar 2008 4:51 PM #2Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 738
- Vote Rating
- 6
bump
Check out SenchaWorld.com for articles, screencasts, conference videos and more.
Sencha Technical Training : Asia Pacific Region
Code Validation : JSLint | JSONLint | JSONPLint
-
26 Mar 2008 6:59 PM #3
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!
-
3 Apr 2008 1:46 PM #4Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 738
- Vote Rating
- 6
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
-
3 Apr 2008 2:01 PM #5
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.
-
3 Apr 2008 6:02 PM #6Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 738
- Vote Rating
- 6
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
-
12 Dec 2008 2:06 AM #7
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


Reply With Quote


