PDA

View Full Version : Error Inserting Buttons in a Window



brunomaia
23 Mar 2010, 5:05 AM
I tried to insert buttons at the Window, but they are inserted into the panel, not the property "buttons".


I tried that:

{
"xtype": "window",
"title": "My Window",
"width": 400,
"height": 250,
"buttons": [
{
"xtype": "button",
"text": "MyButton"
}
]
}

But did it:

{
"xtype": "window",
"title": "My Window",
"width": 400,
"height": 250,
"items": [
{
"xtype": "button",
"text": "MyButton"
}
]
}

Is there any way to do?

aconran
23 Mar 2010, 5:11 AM
Drag a toolbar out into the Window.

Change the toolbar's dock from tbar to fbar.

Place buttons inside of the toolbar.

brunomaia
23 Mar 2010, 5:21 AM
Sure, but the buttons directly on the window will be discontinued or will be discouraged in the future?

aconran
23 Mar 2010, 5:24 AM
Fbar is the preferred way of placing a toolbar into a Panel as of 3.0.0.

buttons is a legacy way of doing the same thing.

brunomaia
23 Mar 2010, 5:32 AM
Thanks, I'll do it now!