2012-01-13 71 views
1

Ext js組合在IE7中不起作用。我需要像虛擬組合一樣的組合行爲(如谷歌搜索)。它是工作在IE9和FF但不是在IE7Extjs組合在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工作。當我按下搜索按鈕時,會顯示一條警報please type Id。這意味着它不需要輸入的值。請幫忙。

+0

你將需要共享更多的代碼。彈出警報的條件是什麼?提交按鈕在哪裏?究竟應該發生什麼? – 2012-01-13 06:14:33

+0

有在端 – sissonb 2012-01-13 06:16:28

+0

@Adam Rackis數組中的一個額外的逗號,即不額外昏迷存在這樣一個isbeforequery代碼:function(){ \t \t \t \t \t \t \t變種VAL = Ext.getCmp('incidentId 「).getValue(); \t \t \t \t \t \t \t \t如果(isNaN(this.getEl()。dom.value)){ \t \t \t \t \t \t \t \t \t Ext.Msg.alert( 「」, 「請輸入數值」 ); \t \t \t \t \t \t \t \t} \t \t \t \t \t \t \t \t否則{ \t \t \t \t \t \t \t \t \t Ext.getCmp( 'incidentId')。getStore()。proxy.setUrl('getIncidentId ?的.html&查詢='+ this.getEl()dom.value)。 \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t} \t \t \t \t \t \t \t} – 2012-01-13 08:41:05

回答

2

我被咬傷這與IE之前:你有你的數組的最後一個元素之後的額外的逗號:

items:[{ 

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

這個問題依然存在......請幫助 – 2012-01-16 05:18:43

+0

它不是多餘的逗號 – 2012-01-30 11:32:34