0

I face following problem in sencha touch.

(1)Uncaught SyntaxError: Unexpected token : (in Morecard1.js line no.:5)

(2)Uncaught Error: The following classes are not declared even if their files have been loaded: 'chat.view.Morecard1'. Please check the source code of their corresponding files for possible typos: 'app/view/Morecard1.js

app.js:

    Ext.Loader.setConfig({

});

Ext.application({
    views: [
        'Home',
        'Morecard1',
        'grouplist',
        'Inner1'
    ],
    stores:[
        'MyStore'
    ],
    models:[
        'MyModel'
    ],
    name: 'chat',

    launch: function() {

        Ext.create('chat.view.Home', {fullscreen: true});
    }

});

Morecard1.js:

Ext.define('chat.view.Morecard1', {
    extend: 'Ext.NavigationView',
    xtype:'Morecard1',
    config: {
        items: [xtype:'Inner1'],
    }
});

Inner1.js:

Ext.define('chat.view.Inner1',{
 
    extend:'Ext.Panel',
 
    xtype:'Inner1',
 
    requires:['Ext.dataview.List','Ext.data.Store'],
 
    config:{
 
        title:'My List',
 
        layout:'fit',
 
        items:[
 
        {
 
             xtype:'list',
 
             store:'MyStore',
 
             itemTpl:'<b>{name}<b>'
 
        }
 
        ]
 
    }
 
});

so what is the problem? I try this but no success.
Thanks in advance.

Community
  • 1
  • 1
DS9
  • 2,995
  • 4
  • 52
  • 102

1 Answers1

0

I change Morecard1.js file and problem solved.

Ext.define('chat.view.Morecard1', {
  extend: 'Ext.NavigationView',
  xtype:'Morecard1',
  config: {
      items: [
        {
          xtype:'Inner1'
        }
      ]
  }
});

here i added {} braces in items. actually i refer first-steps-in-sencha-touch tutorial and there is no braces for this line.and when i put the braces,the error is gone but i have no idea why it is happen?

DS9
  • 2,995
  • 4
  • 52
  • 102