user7374044
user7374044

Reputation: 167

ExtJS handler in button

I have a question about simple button.

Below definition:

var table = null;
var buttonConfig = {
    buttonId: 'mybutton1',
    text: 'Template button',
    icon: 'style/img/fam/button.png',
    tooltip: 'template button',
    handler: function () {
        var someConfig = null;
        fileProcessing(someButton, someConfig);
    }
};
addButtonToGrid(table, buttonConfig);

Function called fileProcessing has 2 args - someButton and someConfig.

I want to pass in someButtton, the button from object buttonConfig. How should I do it ?

Thanks for any advice

Upvotes: 0

Views: 92

Answers (1)

Rohit Sharma
Rohit Sharma

Reputation: 1410

You can do it like below:

handler: function () {
    var someConfig = null;
    var someButton = this;
    fileProcessing(someButton, someConfig);
}

Reference

PARAMETERS

button : Ext.button.Button

This button.

e : Ext.event.Event

The click event.

Hope this will help/guide you.

Upvotes: 1

Related Questions