Reputation: 321
This is my view:
Ext.define('MyApp.view.Login.LoginForm',{
extend: 'Ext.form.Panel',
alias: 'loginForm',
requires: ['Ext.form.FieldSet', 'Ext.Img'],
config: {
items: [
{
xtype: 'fieldset',
items: [
{
xtype: 'textfield',
name: 'username',
required: true
},{
xtype: 'textfield',
name: 'password',
required: true,
inputType: 'password'
},{
xtype: 'selectfield',
//*****************the problem is here****************
store: Ext.StoreManager.lookup('MyApp.store.Tables')
//store: Ext.StoreManager.lookup('Tables')
}
]
},{
xtype: 'button',
text: 'Login',
}
]
}
});
It says that it cannot use lookup of undefined
, so I'm thinking that MyApp doesn't see Ext.StoreManager.
I've also tried Ext.data.StoreManager.lookup
and Ext.StoreMgr
.
BTW. the store really exist.
Upvotes: 4
Views: 5748
Reputation: 6365
Try following these instructions and let me know if it works:
app.js
fileTables.js
store implementation file, give it an storeId
inside its config, like this: config: {storeId: 'Tables'}
store: 'Tables'
Hope it helps.
Upvotes: 2
Reputation: 5700
Your store config should be like this:
Ext.define('MyApp.store.Tables', {
extend: "Ext.data.Store",
config: {
model: "MyApp.model.Table",
data : [{
text: "Ed",
value: "Spencer"
}, {
text: "Tommy",
value: "Maintz"
}]
}
});
And place this into your LoginForm.js:
{
xtype: 'selectfield',
store: 'Tables'
}
I have tested. It is working fine.
Upvotes: 2