PDA

View Full Version : Button in a window



BuckBazooka
7 Apr 2010, 9:31 PM
Hi,

I am trying the designer and I cannot find a way to add buttons at the bottom of a window.

I have a window with a grid panel inside, and I want to place at the bottom of the window a "close" button. In other words how can we set the "button" property of a window.

By hand this is easy but how do I do this with the designer?



buttons= [{text: 'New Accounting Record', iconCls:'addAccountingRecord', handler:onNewAccountingRecord},
{text: 'Save', handler:onSaveInvoice},
{text: 'Cancel', handler:onCancel}];
var w = new Ext.Window({
title: "Invoice: " + invoice.title,
maximizable: true,
width: 1200,
height: 500,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: groupedPanel,
buttons: buttons
});

abe.elias
7 Apr 2010, 10:39 PM
the 'buttons' config has been deprecated for quite some time now.

I've attached an xds file for your review.

Lastly, I'm not sure what 'groupedpanel' was so I just threw in a tab panel for effect. Hope this helps.

BuckBazooka
8 Apr 2010, 6:19 AM
Thanks a lot Abe. That is exactly what I needed and it works very well.
I do not see that "buttons" are deprecated in the API 3.2.0.

mm_202
2 Aug 2010, 10:09 AM
the 'buttons' config has been deprecated for quite some time now.


Where does it say it was deprecated in the docs? I just checked the 3.2.1 API docs and no mention of it.

-- MM.

jarrednicholls
2 Aug 2010, 11:03 AM
I don't know of its deprecation status or intent to be, but it's simply a short hand for specifying the fbar configuration. Since fbar is pretty terse as it is and more flexible anyways, "buttons" is simply redundant and may not be there in a future version (along with buttonAlign). It doesn't explicitly say its deprecated in the docs, so until it does, I would say it's safe to use in your code.

mm_202
2 Aug 2010, 3:24 PM
I don't know of its deprecation status or intent to be, but it's simply a short hand for specifying the fbar configuration. Since fbar is pretty terse as it is and more flexible anyways, "buttons" is simply redundant and may not be there in a future version (along with buttonAlign). It doesn't explicitly say its deprecated in the docs, so until it does, I would say it's safe to use in your code.
Thanks for clarifying that. I basically assumed that, but I wanted it clarified for new users who may stumble across this thread.