PDA

View Full Version : tbar question



bkraut
2 Nov 2009, 7:45 AM
Hi,

I'm unsure about the syntax, how to build what I need. I have an ExtendedFormPanel class where a ttbar is defined with submit and cancel buttons. My forms are subclasses from this ExtendedFormPanel class. My question is, how to access the tbar defined in the superclass.
I need to add a new button in the subclass.

2 Nov 2009, 8:09 AM
you need to do an array push or splice.

Animal
2 Nov 2009, 8:46 AM
Depends whether its rendered or not, and what the tbar configuration object is.

It may be an Array of Components to place inside a Toolbar, in which case you'd use splice.

Or it make be a Component to use as the top toolbar, in which case you'd use Container.insert.

After the Panel has rendered, you'd always use Container.insert

bkraut
3 Nov 2009, 2:46 AM
I just have 3 buttons inside. They are defined in super Class.
But I don't know how to access tbar from other class. This class is subclass of a window with following:



initComponent: function() {
var form = config

//Then here I'd need to add a new Button to the tbar

Ext.apply(form.tbar, {
text: 'New Button'
})

//

call super.

}