-
Uncaught TypeError: Cannot read property 'idProperty' of undefined
Uncaught TypeError: Cannot read property 'idProperty' of undefined
I have a very simple app. For some reason i'm getting this error message Uncaught TypeError: Cannot read property 'idProperty' of undefined
Can someone tell me why?
Ext.Loader.setConfig({ enabled: true });
Ext.application({
name: 'DeviceControl',
appFolder: '../Scripts/DeviceControl',
controllers: ['DeviceControl.controller.CDevice'],
autoCreateViewport: true,
launch: function ()
{
//this is to be fired as soon as the page is ready
}
});
Ext.define('DeviceControl.view.Viewport', {
extend: 'Ext.container.Viewport',
layout: 'fit',
requires: [
'DeviceControl.view.VDevice',
],
initComponent: function ()
{
this.items =
{
items: [{
width: 250,
xtype: 'DeviceView'
}]
};
this.callParent();
}
});
Ext.define('DeviceControl.view.VDevice',
{
extend: 'Ext.form.Panel',
alias: 'widget.DeviceView',
store: ['DeviceControl.store.SDevice'],
//controls go here
initComponent: function ()
{
this.items =
[
{
xtype: 'button',
id:'HBtn'
}
]
this.callParent(arguments);
}
});
Ext.define('DeviceControl.model.MDevice', {
extend: 'Ext.data.Model',
// requires: 'DeviceControl.classes.jsonDeviceProxy',
fields: [
{ name: 'DeviceId', type: 'int' },
{ name: 'Heading', type: 'string' }
]
// hasMany: { model: 'Command', name: 'commands' }
});
Ext.define('DeviceControl.store.SDevice', {
extend: 'Ext.data.Store',
requires: ['DeviceControl.model.MDevice'],
model: ['DeviceControl.model.MDevice'],
autoLoad: true,
proxy:
{
type: 'ajax',
url: 'data/ControlPage.json',
headers: { 'Content-Type': 'application/json; charset=utf-8', 'Accept': 'application/json' },
reader:
{
type: 'json',
root: 'results',
successP:'success'
}
},
load: function ()
{
console.log('store');
}
});
Data:
{
'success': true,
'results':
[
{
'DeviceId': '7',
'Heading': 'Stevie Ray Vaughan',
}
]
}
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us