2014-12-12 5 views
0

Sencha Touch 2.4.0에서 라우팅을 구현하려고하지만 경로 변경 이벤트에서 기능을 시작할 수 없습니다. 내가 메인 컨트롤러 -이Sencha Touch 2.4.0에서 라우팅 구현

Ext.define('STPG.controller.Main', { 
    extend: 'Ext.app.Controller', 

    routes : { 
      'home' : 'onHome' 
     }, 

    config: { 
     refs: { 

     }, 
     control: { 

     } 
    }, 

    //called when the Application is launched, remove if not needed 
    launch: function(app) { 

    }, 
    onHome : function() { 
     console.log('home controller called'); 
    } 
}); 

Ext.Viewport.add(Ext.create('STPG.view.Main')); 
this.redirectTo('home'); 

그 그 함수를 호출하지 trying-

views: [ 
     'Main' 
    ], 

    models: [], 
    controllers: ['Main'], 
    stores: [], 

오전 app.js.

답변

1

당신은 어리석은 실수를하고 있습니다. routes: {}config 안에 넣기 만하면됩니다. 그리고 당신의 문제가 해결되었습니다. 해피 코딩!