0
我想從mongo數據庫中獲取數據並將其添加到extjs文本區域。從商店添加值到extjs textarea
一切都準備好了,我的mongo數據庫返回了我想要添加到extjs文本區域的用戶電子郵件地址列表。
我用這個代碼:
var index = Ext.StoreMgr.lookup("writeup.store.Employee").findExact('name',name);
var rec = Ext.StoreMgr.lookup("writeup.store.Employee").getAt(index);
alert(rec.data.name);
但我得到這個錯誤:
TypeError: Ext.StoreMgr.lookup(...) is undefined
這是我的店
Ext.define('writeup.store.Employee', {
extend: 'Ext.data.Store',
model: 'writeup.model.Employee',
autoLoad: true,
proxy: {
type: 'ajax',
actionMethods: {
read : 'POST'
},
api: {
read : 'user/view.action'
},
reader: {
type: 'json',
root: 'data',
successProperty: 'success'
},
writer: {
type: 'json',
writeAllFields: true,
encode: false,
root: 'employee'
},
listeners: {
exception: function(proxy, response, operation){
Ext.MessageBox.show({
title: 'REMOTE EXCEPTION',
msg: operation.getError(),
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
}
});