我有这个treepanel,我想调用this.getId()
从“展开所有”按钮mainpaneltree的方法但我得到的是方法undefined.I试图把scope:this
在配置对象,但没有成功。范围问题extjs 4
Ext.define('MA.view.patient.Tree', {
extend : 'Ext.tree.Panel',
alias : 'widget.EditPatientTree',
title : 'Simple Tree',
width : 150,
store:'Tree',
dockedItems : [ {
xtype : 'toolbar',
items : [ {
text : 'Expand All',
scope: this,
handler : function() {
//this.expandAll gives "Uncaught TypeError: Object [object DOMWindow] has no method 'getId'"
this.expandAll();
//the same error for this.getId();
this.getId();
}
} ]
} ],
rootVisible : false,
initComponent : function() {
this.callParent(arguments);
}
});
所以我的问题是如何获得参考电流分量和调用它的方法,而你是电流分量