PDA

View Full Version : Combobox opening problem



marzieh312
3 May 2011, 5:59 AM
Dears,

I have a problem in expanding comboboxes in two different window in second time.
As you can see in below code, there is two buttons that show different windows by clicking on each of them. there is a combobox in every window, if I open the first window, expand the combo in it then close this window and after that click on the second button to open the second window and expand the second combo and close it and then try to open the first window and first combo again, this time first combo isnt showing appearently and the list will be hide behind the window.


<script type="text/javascript">
function createGridItemsCountCombo(){
var gridItemsCountStore = new Ext.data.SimpleStore({
fields:['value'],
data: [[10], [20], [50]]
});
gridItemsCountCombo = new Ext.form.ComboBox({
width: 40,
name: 'gridItemsCount',
store : gridItemsCountStore,
displayField : 'value',
value: 10,
triggerAction: 'all',
mode : 'local',
listeners:{
beforequery: function(query){
delete query.combo.lastQuery;
}
}
});
return gridItemsCountCombo;
}

Ext.onReady(function(){
var btn1 = new Ext.Button({
text: 'btn1'
});
btn1.on('click', function(){

win1.show();
});
var btn2 = new Ext.Button({
text: 'btn2'
});
btn2.on('click', function(){
win2.show();
});
var panel = new Ext.Panel({
renderTo: Ext.getBody(),
items: [btn1, btn2]
});
var win1 = new Ext.Window({
width: 100,
height: 100,
minBoxWidth: 600,
minBoxHeight: 500,
resizable: true,
closeAction:'hide',
title: '@@[email protected]@',
plain: true,
frame: true,
modal: true
});
win1.add(createGridItemsCountCombo());
var win2 = new Ext.Window({
width: 100,
height: 100,
minBoxWidth: 600,
minBoxHeight: 500,
resizable: true,
closeAction:'hide',
title: '@@[email protected]@',
plain: true,
frame: true,
modal: true
});
win2.add(createGridItemsCountCombo());
});
</script>


Could you please help me on this? Is this a common issue in combo box or there is something wrong with my code.

Thanks
Marzieh

friend
3 May 2011, 6:37 AM
Your code sample worked correctly for me on Firefox 3.x and IE 8.

However the length of your titles exceed your window's declared width and looks screwy on IE8.

marzieh312
3 May 2011, 10:00 PM
This is just a sample application to show the problem BTW this is not complete application.
Have you tried to open and close the windows and click on the combobox. If you do it 3-4 times you can see the error. It's important to open every other window.
Thank you