PDA

View Full Version : Sencha touch MVC -reference error



prabudc227
7 Feb 2012, 4:23 AM
Hi I am new to Sench touch,
I tried to develop the MVC application given in following tutorial,
http://miamicoder.com/2011/writing-a-sencha-touch-mvc-application/

I followed the same folder structure.
But when i run the application I am getting
Reference error:Can't find variable NotesApp

One of the file containing this error is shown below,
NotesApp.views.MainView=Ext.extend(Ext.Panel,{
fullscreen:true,
layout:'card',
cardSwitchAnimation:'flip',
initComponent:function(){
Ext.apply(NotesApp.views, {
notesListView:new NotesApp.views.NotesListView({
notesStore:NotesApp.stores.notesStore
}),
notesEditorView:new NotesApp.views.NotesEditorView()
});
this.items=[
NotesApp.views.notesListView,
NotesApp.views.notesEditorView
]
NotesApp.views.MainView.superclass.initComponent.call(this);
this.on('render',function(){
NotesApp.stores.notesStore.load();
});
}
});

I do not understand the cause of this error. Please help!!!!

Sameer Khan
7 Feb 2012, 5:49 AM
on() should be called with in the constructor. Not out side of constructor...Plz refer Api once...you will get Idea. where to use.