javascript - Extjs 组合在 IE7 中不起作用

标签 javascript com

Ext js 组合在 IE7 中不工作。我需要这个组合就像带有虚拟组合的文本框(如谷歌搜索)。它在 IE9 和 FF 中工作,但在 IE7 中不工作

这是我的代码:

SearchIncidentForm=new Ext.FormPanel ({

         border:false,
        renderTo:'searchIncidentDiv',   
        id: 'searchIncidentForm',    
        items : [{
            xtype:'panel',
            id :'panelsearchIncident',
            layout:'column',
            defaults:{
                    columnWidth:0.50,
                 labelAlign : 'top',
                 layout:'form',
                 border:false,
                 bodyStyle:'margin-top:5px; '
            },
            border:false,
            items : [{    
                defaults:{anchor:'100%'},
                    items:[{
                        id : "incidentId",
                        fieldLabel : 'Incident Id',
                        labelStyle: 'color: #6C6C6C;width:85px;padding-top:7px;height: 22px;',
                        xtype : 'combo',
                        store:incidentStores,
                        //style: 'width:85px;height: 18px;',
                        width:100,
                        allowBlank : false,
                        labelAlign: 'top',
                        displayField : 'incidentId',
                        valueField : 'incidentId',
                        selectOnFocus : true,
                        typeAhead : false,
                        mode : 'remote',
                        triggerAction : 'all',
                        editable: true,
                        msgTarget:'qtip',
                        listAlign : 'tl-bl?',
                        //anchor : '80%',
                        minChars : 1,
                        hideTrigger:true,
                        hiddenName: 'incidentId',
                        listWidth:100,
                        listHeight:50,

                        submittValue:true,
                        listeners : {
                            specialkey : function(field, e){
                                var key=e.getKey();
                                if (key==e.ENTER) {
                                    incidentSearchButtonHandler();
                                }
                            },

                            beforequery : function(){
                            var val=Ext.getCmp('incidentId').getValue();
                                if(isNaN(this.getEl().dom.value)){
                                    Ext.Msg.alert("","Please type numeric value");
                                }
                                else{
                                    Ext.getCmp('incidentId').getStore().proxy.setUrl('getIncidentId.html?&query='+this.getEl().dom.value);

                                }
                            }
                        }

                    }]
                },{ 

                    items:[{
                        xtype : 'button',
                        text : 'Search',
                        style: 'margin-top:19px;margin-left:20px;width:50px;',                  
                        width: 35,
                        height:15,
                        handler : incidentSearchButtonHandler   
                    }]
                }]
        }]
    });
}

但它在 IE 中不起作用。当我按下“搜索”按钮时,会显示一条警告,提示 请输入 Id。这意味着它不采用已键入的值。请帮忙。

最佳答案

我以前在 IE 上遇到过这个问题:在数组的最后一个元素之后有一个额外的逗号:

items:[{

    submittValue:true,
    listeners : {
        specialkey : function(field, e){
            var key=e.getKey();
        if (key==e.ENTER) {
            incidentSearchButtonHandler();
        }
    },  // <------ Extra comma.  Delete it.
]}

关于javascript - Extjs 组合在 IE7 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8846532/

相关文章:

javascript - 在 AngularJS 中使用 $routeProvider 将 Controller 分配给表单模板

javascript - 根据字符串的特定部分进行 Alpha 排序

javascript - 如何从使用 javascript 动态添加的文本框获取值 - c#

c# - 基于非零的多维数组

c++ - 如何使用 msxml 解析器创建子元素?

visual-studio-2010 - EnvDTE 的类型库在哪里?

javascript - 日期格式的谷歌图表范围过滤器控件

javascript - 使用javascript动态创建具有多个元素的多个div?

c# - C# 编译器如何检测 COM 类型?

.net - XmlSchema.Read 给出 COMException "Catastrophic failure"