Hybrid View
-
28 Nov 2012 11:40 PM #1
Controller action with buffer for the event handler ?
Controller action with buffer for the event handler ?
Hello Forum,
is there a way to set a buffer on a controller action as in the options parameter of Ext.util.Observable.addListener() ?
Please give me a hint to try this.First I would like to thank you for your time and knowledge
Win 7 Ext JS 4.1.3 IE(6-9), FF17
-
29 Nov 2012 11:36 AM #2
No, you'd have to buffer it at the event level or controller level manually via a delayed task.
Aaron Conran
@aconran
Sencha Architect Development Team
-
29 Nov 2012 10:50 PM #3
Thank you !
I have a toolbar with a lot of toggle buttons in different groups and since they are handling the same components and stores I have to play with a buffer for their event handler.
1. I initialize an Ext.util.DelayedTask() in my Controller, I do this in the init() method
2. Then I delay the logic of my controller action handler(see Ext.util.Event.addListener and Ext.util.Event.createBuffered)Code:this.task = new Ext.util.DelayedTask();
It works for me, even if I'm not shure if this is an efficient way of doing it.PHP Code:onShiftButtonToggle: function(button, pressed, options) {
this.task.delay(1000, function(){
if(pressed){
console.log(button.getText());
}else{
console.log('do nothing');
}
}, this, [button, pressed, options]);
}
First I would like to thank you for your time and knowledge
Win 7 Ext JS 4.1.3 IE(6-9), FF17


Reply With Quote