Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3930 in 2.2.0-b1.
  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    27
    Vote Rating
    0
    crgrah is on a distinguished road

      0  

    Default suspend/resume events issues

    suspend/resume events issues


    Code:
    var me = this;
    
    
    if (record.data.Link.length > 0)  //link
    {
        //populate link
        if (record.data.Link.substr(0,5) == 'http:')
            iframe = '<iframe class="iframelink" src="'+record.data.Link+'"></iframe>';
        else
            iframe = '<iframe class="iframelink" src="http://'+record.data.Link+'"></iframe>';
        Ext.ComponentQuery.query('#LibraryBrowserContainer')[0].setHtml(iframe);
        //save LibraryFolderID
        Ext.ComponentQuery.query('#LibraryIDHiddenField').value = record.data.LibraryFolderID;
        me.record = record;
        //stop scroll to next level - highlight listitem
        nestedlist.suspendEvents(false);
        //e.stopEvent();
    }
    else if (record.data.DocumentID > 0) //document
    {
        //populate document body
        var document = me.GetDocumentBody(record.data.DocumentID);
        Ext.ComponentQuery.query('#LibraryBrowserContainer')[0].setHtml(document);
        //save LibraryFolderID
        Ext.ComponentQuery.query('#LibraryIDHiddenField').value = record.data.LibraryFolderID;
        me.record = record;
        //stop scroll to next level - highlight listitem
        nestedlist.suspendEvents(false);
        //e.stopEvent();
    }
    else if (record.data.Deletable) //empty folder
    {
    }
    nestedlist.resumeEvents();
    The above code does not work, ie setting suspendEvents(false) does not clear out the event queue....

    Any ideas why?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Looking at the source, we actually don't do anything with the argument.

    Code:
        /**
         * Suspends the firing of all events. (see {@link #resumeEvents})
         *
         * @param {Boolean} queueSuspended Pass as true to queue up suspended events to be fired
         * after the {@link #resumeEvents} call instead of discarding all suspended events.
         */
        suspendEvents: function(queueSuspended) {
            this.eventFiringSuspended = true;
        },
    
        /**
         * Resumes firing events (see {@link #suspendEvents}).
         *
         * If events were suspended using the `queueSuspended` parameter, then all events fired
         * during event suspension will be sent to any listeners now.
         */
        resumeEvents: function() {
            this.eventFiringSuspended = false;
        },
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    27
    Vote Rating
    0
    crgrah is on a distinguished road

      0  

    Default So thats a BUG then

    So thats a BUG then


    Can you suggest how I should go about cancelling all the events in the queue
    at that point then?

    I'm thinking jquery 'unbind', but how do I name the events in the queue?

    cheers

Tags for this Thread