2011-01-06 80 views
1

沒有使用Extjs一段時間,我已經有點生鏽了!Extjs Combobox無法選擇項目

我有以下組合框:

代碼:

NameSpace.DirectCombo = Ext.extend(Ext.form.ComboBox, { 
    displayField: 'Name', 
    valueField: 'Id', 
    triggerAction: 'all', 
    queryAction: 'Name', 
    forceSelection: true, 
    mode: 'remote', 
    initComponent: function() { 
     this.store = new Ext.data.DirectStore(Ext.apply({ 
      api: this.api, 
      root: 'data', 
      fields: this.fields || ['Name', 'Id'] 
     }, this.storeConfig)); 

     NameSpace.DirectCombo.superclass.initComponent.call(this); 
    } 
}); 

NameSpace.LocationCombo = Ext.extend(NameSpace.DirectCombo, { 
    storeConfig: { 
     id: 'location-combo-store' 
    }, 
    initComponent: function() { 
     Ext.apply(this.storeConfig, { 
      directFn: Location.AllHasLineupList, 
      baseParams: { Id: selectedNodeId } 
     }); 
     NameSpace.LocationCombo.superclass.initComponent.call(this); 
    } 
}); 

加載並做整個預輸入事情的罰款。

但是,當我嘗試在建議中選擇一個項目,它不會選擇它!

我在這裏做錯了什麼?

回答

0

嘗試這些屬性的組合,那麼你得到預輸入,它允許seleciton:

editable : true, 
typeAhead : true, 
forceSelection : true, 
disableKeyFilter : true, 
triggerAction : 'all', 
mode : 'local' 
+0

嘿,感謝 - 我會檢查這個在今天晚些時候和回來:) – iwayneo 2011-01-15 11:07:57