Rick Hoving
Rick Hoving

Reputation: 3575

Add after event listener in configuration

I know it is possible to add listeners to events that fire after the event has fired like this:

oDocumentCategories.addAfterListener("activeitemchange", function(oContainer, sValue, oldValue){
    //Do stuff here
});

But is it also possible to attach them whilst creating the elements?
Just like this:

var oButton = Ext.create("Ext.Button", {
            text: "Button",
            listeners: {
                tap: function(){
                    //Tap event here
                }
            }
        });

But only then for an after listener.

Question
Is it possible to attach an after event listener whilst creating an element?
Just like the listeners configuration property but then for an after event listener.

Upvotes: 0

Views: 419

Answers (1)

olegtaranenko
olegtaranenko

Reputation: 3850

 var oButton = Ext.create("Ext.Button", {
      text: "Button",
      listeners: {
            tap: {
               fn: function(){
                //Tap event here
               },
               // scope: this,
               // options: {single: true}
               order: 'after'
           }
      }
 });

Cheers, Oleg

Upvotes: 2

Related Questions