グリッドがあり、このグリッドのtbarにあるいくつかのボタンを(コントローラーから)制御したい場合。
itemIdプロパティを持つボタンを見つけることができますが、クラスごとにボタンを見つける方法と、どのクラスを使用する必要がありますか(baseCls、clsなどがあり、それらは機能しません)?
これが私のコントローラーコードです:
Ext.define("Wtb.controller.Schedule",{
extend:'Ext.app.Controller',
refs:[{
ref:'grid',
selector:'button'
}],
init: function () {
this.control({
'button#remove':{
click:this.Remove
},
'button#refresh':{
click: this.Load
},
'button#save':{ //Buttons with id works fine
click:this.Save
},
'button.period':{ //It can't be found, because here is the class
click:this.changePeriod
}
})
そしてここにボタンスニペットがあります:
{ //Button with ID
xtype:"button",
itemId:'refresh',
text:"Refresh"
},'->',{ //Button with class. I need some buttons, like this.
xtype:"button",
text:"Period - day",
cls:'period',
value:'day'
}
コントローラからクラスごとにボタンを見つける方法は?