2013-07-22 67 views
0

我試圖簡單地將商店數據存儲到可以選擇的組合框中。將「商店」數據放入組合框

這裏是我的store.Users:

Ext.define('AM.store.Users', { 
    extend: 'Ext.data.Store', 
    model: 'AM.model.User', 
    fields: ['name', 'email'], 
    data: [ 
     {name: 'Ed Hayes', email: '[email protected]'}, 
     {name: 'Tommy Gunz', email: '[email protected]'}, 
     {name: 'Johnny Bravo', email: '[email protected]'}, 
     {name: 'Billy Joe', email: 'billyJgeemail.com'}, 
     {name: 'James Bond', email: '[email protected]'} 
    ] 
}); 

這裏是我的app.js:

items: [ 
    { xtype: 'panel', 
     padding: 5, 
     height: 500, 
     width: '35%', 
     items: [ 
      { 
      xtype: 'combobox', 
      padding: 5, 
      fieldLabel: 'Criteria', 
      stores: 'AM.store.hello' 
      } 
     ] 
    }, ... 

目前,這是行不通的,任何想法?

回答

0

你應該正確指定組合框性能,尤其是商店和displayField:

{ 
    xtype: 'combobox', 
    fieldLabel: 'Criteria', 
    displayField: 'name',// or email 
    name:.., 
    valueField:.. 
} 
相關問題