2013-03-04 154 views
1

我正在使用extjs4。如何在另一个成员函数(showSubject)中调用成员函数(hellotest)?如何在extjs4的另一个函数中调用函数?

我试图在事件subjectBar(它是showSubject函数的一部分)中添加hellotest的呼叫。我试图使用范围使用该函数调用,但这并没有工作,我得到了以下错误:object[object object] error undefined function

这里是我的一些代码:

Ext.define('Am.DnycontentcategoriesController', { 
    extend: 'Ext.app.Controller', 

    init: function() { 

     this.control({ 
      //'viewport > panel >Contentcategories': 
      'Contentcategories': { 
       render: this.showSubject, 
      } 
     }); 
    }, 
    hellotest: function() { 
     console.log("inside hello test function"); 
    }, 


    showSubject: function() { 
     //console.log(this.hellotest()); 
     subjectBar.on('tabchange', function() { 
      //here I am getting error 
      this.hellotest(); 
      var tab = subjectBar.getActiveTab(); 
      -------- 

     }); 
    }, 

回答

相关问题