Victor Velasco
Victor Velasco

Reputation: 37

Trigger an event after clicking browse button in file upload field Extjs

I am new in Extjs and I just had an issue with a fileuploadfield, basically what I want to do is to trigger an new event after clicking the browse button. I want to trigger both event. The one by default and the new event I am going to develop. Is there any way of doing that ?

Upvotes: 0

Views: 1018

Answers (1)

Alexander
Alexander

Reputation: 20224

After render of the file upload field, you want to attach to the trigger component's click event like this:

listeners: {
    afterrender: function(field) {
        field.getTrigger('filebutton').component.on('click', function() {
            Ext.Msg.alert('Browse button clicked');
        });
    }
}

https://fiddle.sencha.com/#view/editor&fiddle/2dn5

Upvotes: 1

Related Questions