简体   繁体   English

按钮中的ExtJS处理程序

[英]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 . 名为fileProcessing函数有2个args- someButtonsomeConfig

I want to pass in someButtton , the button from object buttonConfig . 我想传入someButtton ,这是来自对象buttonConfig的按钮。 How should I do it ? 我该怎么办?

Thanks for any advice 感谢您的任何建议

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 e:Ext.event.Event

The click event. 点击事件。

Hope this will help/guide you. 希望这会对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM