Greg
Greg

Reputation: 1377

Sencha Touch Kitchensink app "clone" - model not found

I have tried to clone the Speakers example from the Kitchen Sink -Sencha App into my own app. I copied the model (Speaker.js), store (Speakers.js), view (BasicDataView.js), feed (feed.js) and changed the name of the first element of the class path from Kitchen Sink to MyFirstApp.

my app.js looks as follows:

Ext.Loader.setConfig({
    enabled: true
});

Ext.application({
    name: 'MyFirstApp',

    controllers: ['Main'],
    //loads app/store/Demos.js, which contains the tree data for our main navigation NestedList
    stores: ['Speakers'],

    launch: function() {
       Ext.create('MyFirstApp.store.Speakers', { id: 'Speakers' });
       MyFirstApp.util.Proxy.process('feed.js');    
           Ext.create('MyFirstApp.view.Viewport');
       }
    });

However, the App won't start. My Chromium debugger tells me the following:

Uncaught Error: [ERROR][Ext.data.Store#setModel] Model with name "MyFirstApp.model.Speaker" does not exist. Console.js?_dc=1395265484974:17
Ext.define.doWrite Console.js?_dc=1395265484974:17
Ext.define.write Writer.js?_dc=1395265484999:49
Ext.define.log Logger.js?_dc=1395265484923:132
(anonymous function) Logger.js?_dc=1395265484923:150
Ext.define.applyModel Store.js?_dc=1395265486959:901
Ext.apply.generateSetter.setter sencha-touch.js:5544
Base.implement.initConfig sencha-touch.js:4982
Ext.define.constructor Store.js?_dc=1395265486959:833
Ext.apply.create.Class sencha-touch.js:5270
(anonymous function)
Ext.ClassManager.instantiate sencha-touch.js:7011
Ext.apply.factory sencha-touch.js:10120
Ext.define.instantiateStores Application.js?_dc=1395265486668:770
Ext.define.onDependenciesLoaded Application.js?_dc=1395265486668:685
Ext.apply.refreshQueue sencha-touch.js:8260
Ext.apply.refreshQueue sencha-touch.js:8261
Ext.apply.refreshQueue sencha-touch.js:8261
Ext.apply.refreshQueue sencha-touch.js:8261
Ext.apply.refreshQueue sencha-touch.js:8261
Ext.apply.refreshQueue sencha-touch.js:8261
Ext.apply.onFileLoaded sencha-touch.js:8589
(anonymous function) sencha-touch.js:3270
Ext.apply.injectScriptElement.onLoadFn

What might possibly have gone wrong? I guess I tried comparing the Kitchen Sink app with my app dozens of times and don't see differences, apart from the contents of bootstrap.js.

The whole code of the app is here.

Upvotes: 1

Views: 543

Answers (2)

Anand Gupta
Anand Gupta

Reputation: 5700

My suggestion is first you follow any Sencha tutorial. I am listing some og your mistakes:

  1. You have not added models and views in app.js file.
  2. Your shared app's code is not having Viewport.js and also store and model files are missing.

Upvotes: 3

Greg
Greg

Reputation: 1377

the code lacks declaration of the model in app.js. Not exactly sure why but that fixes the problem.

Upvotes: 0

Related Questions