0
如果有一個網格,我想控制(從控制器)該網格的tbar中的一些按鈕。ExtJS4 MVC:如何按類別選擇按鈕
我可以找到按鈕,它有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'
}
如何通過類從控制器找到按鈕?
CLS財產不能正常工作。我拿了componentCls並使用它。 – 2012-04-05 06:27:19
它適合我。謝謝!! – 2016-07-07 21:45:09