Hybrid View

  1. #1
    Touch Premium Member msinn's Avatar
    Join Date
    Jul 2009
    Location
    in front of my pc
    Posts
    280
    Vote Rating
    5
    msinn is on a distinguished road

      0  

    Question 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

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,270
    Vote Rating
    122
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      1  

    Default


    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

  3. #3
    Touch Premium Member msinn's Avatar
    Join Date
    Jul 2009
    Location
    in front of my pc
    Posts
    280
    Vote Rating
    5
    msinn is on a distinguished road

      0  

    Default


    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
    Code:
    this.task = new Ext.util.DelayedTask();
    2. Then I delay the logic of my controller action handler(see Ext.util.Event.addListener and Ext.util.Event.createBuffered)

    PHP Code:
    onShiftButtonToggle: function(buttonpressedoptions) {
        
    this.task.delay(1000, function(){
            if(
    pressed){
                
    console.log(button.getText());
            }else{
                
    console.log('do nothing');
            }
        }, 
    this, [buttonpressedoptions]);

    It works for me, even if I'm not shure if this is an efficient way of doing it.
    First I would like to thank you for your time and knowledge

    Win 7 Ext JS 4.1.3 IE(6-9), FF17