PDA

View Full Version : Possible to add other items to button area of window?



dbassett74
16 Jul 2009, 6:44 AM
Not sure if this is possible or not, but I want to do something like the attached image. Any help would be appreciated.

makana
16 Jul 2009, 7:32 AM
You can set

buttonAlign: 'left'
and use the config option fbar instead of buttons and treat it like a normal Toolbar.
Let's say:


Ext.Window({
buttonAlign: 'left',
fbar: [{
xtype: 'textfield',
width: 100
},'->',{
text: 'button1'
},{
text: 'button2'
}]
});

I've found out, that something goes wrong with the width of comboboxes. The width of the wrapping Element is set to 0px and so the following buttons are underneath the combo. At the moment, I don't know how to solve it. There's something wrong in TriggerField.js... Normal Fields work.

Following this link can be interesting: http://extjs.com/forum/showthread.php?t=67274

dbassett74
16 Jul 2009, 8:04 AM
Works perfectly. Check out the new screenshot. I'm using the release of 3.0 and have no rendering issue. Thanks again!

makana
16 Jul 2009, 8:52 AM
I'm using ext3.0 as well, but I guess, I have added the fbar to the panel which is inside the window. So it was my mistake, sorry! Nice to know, that it works directly on Ext.Window :)

makana
16 Jul 2009, 8:57 AM
No, it's wrong... It SEEMS like it works perfect. I've tested it again, but now directly in Ext.Window.
Try to shrink the window size or add a button between combo and fill-item and you know, what I mean. Let's say so:


Ext.Window({
buttonAlign: 'left',
fbar: [{
xtype: 'combo',
width: 100
},{
text: 'TESTBUTTON'
},'->',{
text: 'button1'
},{
text: 'button2'
}]
});

Inspect the combo with firebug and you'll see, that the wrapping-element-width is set to 0px

dbassett74
16 Jul 2009, 2:21 PM
So you're doesn't look like the last screenshot I attached? Mine is working perfect.

makana
16 Jul 2009, 10:53 PM
Of course, I saw that!!
But I think, it is, because your window is wide enough and you have a fill-item ('->') directly after the combo.
I attached a screenshot to show you, what I mean in my previous post. Seems like there's a bug in TriggerField.js which sets the wrapper-width to 0px.
So if you place items between the combo and the fill-item, they are underneath the combo.
I've done this (simplified):

new Ext.Window({
buttonAlign: 'left',
fbar: [{
xtype: 'combo',
width: 100
},{
text: 'TESTBUTTON'
},'->',{
text: 'abbrechen'
},{
text: 'verschieben',
disabled: true
}]
});

Look at the screenshot: