Threaded View

  1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,311
    Vote Rating
    109
    LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light

      0  

    Default EventBus - suspending events

    EventBus - suspending events


    Here's a code fragment from my controller.

    I have a private method that sets a checkbox value. I want to suspend events on the checkobx so the change event is not fired. I tried to call suspendEvents on the checkbox, but this wasn't effective. Now I'm calling suspendEvents on the eventbus, and this is working for me. Am I doing it right?

    Also, looking at the EventBus code... I'm curious why the EventBus class is not a singleton since there's only one eventbus in an application.

    I probably don't fully understand the Ext.override feature, but why the Ext.app.EventBus class overrides the Ext.Component.fireEvent class as opposed to using the Ext.Function methods to create an interceptor?

    Code:
    Ext.define('StoreLayout.controller.ConfigViewController', {
        extend: 'Ext.app.Controller',
    
        ...
        // @private
        setCheckboxValue: function (checkbox, value) {
            var me = this,
                eventbus = me.application.eventbus,
            ...
            eventbus.suspendEvents();
            checkbox.setValue(value);
            eventbus.resumeEvents();
        },
        ...
    });
    ***EDIT
    >>> Now I'm calling suspendEvents on the eventbus, and this is working for me. Am I doing it right?

    After more testing, calling suspendEvents on the eventbus is not reliable. I guess I'm stuck. How do I suspend events in a controller?
    Last edited by LesJ; 15 Mar 2012 at 6:26 AM. Reason: Clarification about eventbuss.suspendEvents

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi