クリックしても ExtJS ボタンのハンドラーが呼び出されません。コードは次のようになります。
Ext.define('EDS.view.selector.Container', {
extend: 'Ext.form.Panel',
alias : 'widget.selectorcontainer',
title: 'Selector_V2',
renderTo: 'input-div',
layout: 'fit',
height: '100%',
items: [
{
xtype: 'tabpanel',
defaults: {
bodyPadding: 10
},
}
],
buttons: [
{
text: 'Reset',
handler: function(){
console.log("Reset");
this.up('form').getForm().reset();
}
},
{
text: 'Add to constrain',
handler: this.addConstrain,
}
],
/*
* Logic for button "Add to constrain"
*
* Adds an entry into the constrain list describing a person, cost center or an application
*/
addConstrain: function(button, event){
console.log('Add_to_constrain clicked');
}
});
もともと、この「selectorcontainer」は私の app.js に直接入れられました。しかし、私はそれをスタンドアロン ビューに抽出しました。抽出前は完璧に機能していましたが、現在は機能していません。
ところで、2 つのボタンがあり、最初の「リセット」は正常に機能します。そこで、スコープ関連の「this.addConstrain」に何か問題があるのではないかと考えています。