View Full Version : Quick debug help?

4 Oct 2011, 2:44 AM
Hi Guys,

I'm new to Sencha and coding my first app... but can't seem to get over this error; :(

Uncaught TypeError: Cannot read property 'model' of undefined

So I defined a model;

MyModel: Ext.regModel('myModel', {
{ name: 'id', type: 'int' },
{ name: 'user', type: 'int' },
{ name: 'description', type: 'string' },
{ name: 'amount', type: 'string' },
{ name: 'date', type: 'string' }

Defined a store (request.php returns JSON from a MySql query)

onlineStore: new Ext.data.Store({
model: 'MyModel',
proxy: {
type: 'ajax',
url: 'request.php',
reader: new Ext.data.JsonReader

and finally, create a tab panel and assign this stuff to a list (items);

items: [
{cls:'welcome', title:'Welcome'},
cls: 'myStuff',
title: 'My Stuff',
xtype: 'list',
store: onlineStore,
itemTpl:'{id} - {description} - &pound;{amount} - {date}<br />'

Can anybody see any obvious reason for this error? have NO idea :(