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.
Printable View
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.
No, you'd have to buffer it at the event level or controller level manually via a delayed task.
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]);
}