PDA

View Full Version : ComboBox does not dropdown in Ext.Window on 2nd show()



StevenMcD
24 Feb 2010, 2:14 AM
been struggling with an issue now for a day or two. I have an Ext.Window that contains 2 combo-boxes. on the first load everything works fine, both stores are populated and the combo's work as they should.

However, if I .show() the window a second time, the combo boxes do not "drop down" to display the lists. I have checked Firebug and there are no entries being added to the combo boxes although the stores are being populated.

Here is the code of the Window:


uTransferWindow = new Ext.Window({
id : 'windowUserLicenseTransfer',
title : 'Title',
width : 405,
autoScroll : true,
closeAction : 'hide',
closable : false,
modal : true,
bodyStyle : 'background-color:#FFF',
buttonAlign : 'center',
items : new Ext.form.FormPanel({
labelAlign : 'left',
labelWidth : 140,
bodyStyle : 'padding:10px 10px 0 10px',
border : false,
defaults: {
xtype: 'ComboBox',
anchor: '100%',
tpl: '<tpl for="."><div class="x-combo-list-item"><div style="position:absolute;left:4px;">{initials}</div><div style="position:relative;left:50px;">{username}</div></div></tpl>',
displayField: 'username',
valueField: 'userid',
typeAhead: true,
mode: 'local',
triggerAction: 'all'
},
items: [{
hiddenName: 'fromuserid',
fieldLabel: 'From User',
id : 'drop1',
store: userswithlicenses
}, {
hiddenName: 'touserid',
fieldLabel: 'To User',
id : 'drop2',
store: userswithoutlicenses
}]
}),
buttons : [{
text : 'Transfer License',
handler : function() {
//do stuff
}
}, {
text: 'Cancel',
handler: function() { uTransferWindow.hide(); }
}]
}),

I have not been able to find anyone else with a similar problem on the forums, any help would be appreciated.

StevenMcD
24 Feb 2010, 6:53 AM
it seems the z-index on the body of the window is changing the second time its shown except the combo boxes z-index does not change so the lists are expanding behind the the window if that makes any sense.

Any ideas on how to prevent this?

Juan Bolivar
8 Jun 2010, 5:51 AM
I have the same problem. The comboboxes expand behind the window after I open it a second time.

Something I have done in some cases to avoid this, is to always recreate the window. But that is not the best fix.
We need Ext fix this unwanted behavior.

Any solutions for this?

Thank you.

Juan Bolivar
8 Jun 2010, 5:57 AM
It seems they have fixed it for 3.2.2

http://www.extjs.com/products/js/CHANGES_ext-3.2.2.html


ComboBox - Added a fix to ensure the z-index of the list is calculated every time the combo is shown.

klerick
22 Jun 2010, 3:54 AM
http://www.sencha.com/forum/showthread.php?97227-CLOSED-Combo-Z-Index-issue&p=459092#post459092