나는이 treepanel을 가지고 있으며 내부의 "전체 확장"버튼에서 this.getId()
메서드를 호출하려고합니다. 그러나 나는 정의되지 않은 메서드입니다. 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);
}
});
그래서 제 질문은 현재 구성 요소에 대한 참조를 얻을 당신이