Javascript Extjs searchfield无法读取属性';拥有自己的财产';未定义的
我有下一家店:Javascript Extjs searchfield无法读取属性';拥有自己的财产';未定义的,javascript,extjs,Javascript,Extjs,我有下一家店: Ext.define('Invoices.store.Invoice', { extend: 'Ext.data.Store', model: 'Invoices.model.Invoice', alias: 'store.InvoiceStore', remoteFilter: false, proxy: { type: 'ajax', url: '/invoices/filter', reader: { type: 'json'
Ext.define('Invoices.store.Invoice', {
extend: 'Ext.data.Store',
model: 'Invoices.model.Invoice',
alias: 'store.InvoiceStore',
remoteFilter: false,
proxy: {
type: 'ajax',
url: '/invoices/filter',
reader: {
type: 'json'
}
},
autoLoad: false
});
这个模型:
Ext.define('Invoices.model.Invoice', {
extend: 'Ext.data.Model',
fields: ['data']
});
当我从视图调用此组件时,错误显示:
{
xtype: 'searchfield',
name: 'client',
store: 'InvoiceStore',
fieldLabel: 'Cliente<b><span style="color: #d32f2f">*</span></b>'
},
Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined
我认为这是因为传递给组件(可能是存储)的null引用导致的,但我更改了别名和模型,但什么也没有发生,仍然显示相同的错误
有什么帮助吗?有什么想法吗?我应该被解雇吗?据我所知,你没有在任何地方创建商店实例。如果您只是传递一个字符串,这意味着它是一个已经存在的存储的id。如果要按别名创建存储(我认为您正在尝试这样做),则需要如下指定:
store: {
type: 'InvoiceStore'
}
store: {
type: 'InvoiceStore'
}