2011-10-19 34 views
0

我很难理解为什么我不能回到我的应用程序中的前一个面板。少废话,一些代码不能回到前面板在Sencha使用“this.ownerCt.setActiveItem ...”

appsDetails = Ext.extend(Ext.Panel, { 
layout: 'fit', 
scroll: 'verticall', 

initComponent: function() { 

    this.dockedItems = [{ 
     xtype: 'toolbar', 
     items: [{ 
      ui: 'back', 
      scope: 'this', 
      handler: function() { 

       console.log(this.ownerCt) //This returns "undefined" 

       this.ownerCt.setActiveItem(this.prevCard, { 
        type: 'slide', 
        reverse: true, 
        scope: this, 
        after: function() { 
         this.destroy(); 
        } 
       }) 
      } 
     }] 
    }]; 

    this.items = [{ 
     styleHtmlContent: true, 
     tpl: description, 
     data: this.record.data 
    }]; 

    appsDetails.superclass.initComponent.call(this); 
} 
}); 

我在前面的面板下方使用此代码获取这个观点上述

selection: function(list, index) { 

if (index[0] !== undefined) { 
    var details = new appsDetails({ 
     homeCard: this.appsPanel, 
     record: index[0], 
    }); 

    this.setActiveItem(details, {type: 'slide', direction: 'left'}) 
} 
} 

我没有问题,得到所需面板,但我不能来回到前一个。

THX对您有所帮助

回答

0

你传递一个字符串对象与价值'this'。改变这一行:scope:'this' in scope:this

+0

谢谢,我没有看到:)现在,我回到前面的面板,我注意到,我需要点击两次以前选择的项目,以回到它的描述或一次在另一个项目上这样做。任何想法? – slmd