biohazardo
4 Apr 2012, 5:52 AM
Hello.
I'm using MVC application type.
I want to control some buttons in grid toolbar from controller.
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':{
click:this.Save
},
'button.period':{ //It can't work
click:this.changePeriod
}
})
... some methods ...
It can find buttons by itemId, but I need create some same buttons to select period type, and take "value" property from button. But I can't create many buttons with one itemId. I need something like class.
I tried baseCls, cls properties of button, but they don't work. What I need to control that buttons? How to query that buttons?
Here is some button code snippets:
{ //That one work nice by id. I can user id here.
xtype:"button",
itemId:'refresh',
text:"Refresh"
},'->',{ //That one can't be find by class. Need some buttons, like this.
xtype:"button",
text:"Period - day",
cls:'period',
value:'day'
}
I'm using MVC application type.
I want to control some buttons in grid toolbar from controller.
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':{
click:this.Save
},
'button.period':{ //It can't work
click:this.changePeriod
}
})
... some methods ...
It can find buttons by itemId, but I need create some same buttons to select period type, and take "value" property from button. But I can't create many buttons with one itemId. I need something like class.
I tried baseCls, cls properties of button, but they don't work. What I need to control that buttons? How to query that buttons?
Here is some button code snippets:
{ //That one work nice by id. I can user id here.
xtype:"button",
itemId:'refresh',
text:"Refresh"
},'->',{ //That one can't be find by class. Need some buttons, like this.
xtype:"button",
text:"Period - day",
cls:'period',
value:'day'
}