PDA

View Full Version : buttons and toolbars don't get an ownerCt attribute



bluescreen303
2 Apr 2008, 7:00 AM
Hi,

I'm trying to create some action-handling functionality, where I can supply a string as handler to a button. The button will then use a stub/proxy handler, which (when called) will look for the action(string) by bubbling up the container-tree till it finds a container that has an 'actionHandler' attached.

Say I have a panel, which contains (along other things) a grid.
The grid has a toolbar with buttons.
This main panel is 'bound' to my application(kind of like a controller).
Now when I tell a button that its handler is 'logout'(string), it tries to locate a handler/controller which has a method called 'logout', and re-binds the handler to this.

This all works like it should, but I had to do some overrides.
For some reason, a toolbar receives no ownerCt, also the buttons don't get the toolbar as their ownerCt.

I can override this manually but I was wondering why this isn't done by default.
Any specific reason for this?

Greetings,
Mathijs

Animal
3 Apr 2008, 12:16 AM
In Ext 2.0, the Toolbar is not a Container - check it out, it does not implement Ext.Container, so it does not conform to the scheme.

This is a very well known shortcoming, and a lot of people have commented on it. It's good that you fixed up an override, but wait till you see what Ext 3.0 has to offer =P~=P~

The Toolbar is a fully fledged Ext.Container integrated into the Panel (Its ownerCt is its Panel).

A Panel's top and bottom Toolbars are fully integrated into the Panel's size management along with the header, body and footer.

Toolbar Buttons can be different sizes, can be grouped into button panels, can be aligned left/right, and can have menu arrows at the right or bottom.

Obviously, this means that Buttons have an ownerCt too.