ExtJS 4.2.2 ComboBox fields show up behind Window

懵懂的女人 提交于 2019-12-12 01:05:14

问题


I'm having an issue where I pop up a window with a loaded comboBox, and when I click on it, the fields show up behind the window.

Thinking I may be using some setting wrong, I created a small test based off the documentation of the ComboBox, and it does it here for me as well. (If you try it, may need to drag the bottom of the window up to see the options)

showTestWindow = function() {
var states = Ext.create('Ext.data.Store', {
    fields: ['abbr', 'name'],
    data : [
        {"abbr":"AL", "name":"Alabama"},
        {"abbr":"AK", "name":"Alaska"},
        {"abbr":"AZ", "name":"Arizona"}
        //...
    ]
});

var window = Ext.create('Ext.window.Window', {
    width: 525,
    height: 280,
    items: [// Create the combo box, attached to the states data store
                {
        xtype: 'combobox',
            fieldLabel: 'Choose State',
            store: states,
            queryMode: 'local',
            displayField: 'name',
            valueField: 'abbr'
                }
    ]
}).show();
}

I created a JSFiddle, but it doesn't have the issue. http://jsfiddle.net/N9VUr/ (I assume something is different about the JSFiddle environment?)

I've tried this with both Firefox and Internet Explorer

Is this a Sencha bug, or am I doing something wrong? What's the easiest way to fix this?

Edit

Also, reassurance that it isn't just my local settings or something on my end would be appreciated if I could get someone else to test it as well.

Screenshot:


回答1:


The quickest solution if you rush for a fix is by adding css.

.x-combo-list{z-index:100000 !important;}



回答2:


The behavior you observe could be related to the fact that you create the combo before the window.

Use xtype to defer the creation of the checkbox to the rendering of the window.

var window = Ext.create('Ext.window.Window', {
    width: 525,
    height: 280,
    items: [{
        xtype: 'combobox',
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr'
    }]
}).show();



回答3:


This issue might be caused by error in other block of code on current page. This opinion based on my own experience



来源:https://stackoverflow.com/questions/21102624/extjs-4-2-2-combobox-fields-show-up-behind-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!