繁体   English   中英

按钮中的ExtJS处理程序

[英]ExtJS handler in button

我对简单按钮有疑问。

下面的定义:

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);

名为fileProcessing函数有2个args- someButtonsomeConfig

我想传入someButtton ,这是来自对象buttonConfig的按钮。 我该怎么办?

感谢您的任何建议

您可以按照以下方式进行操作:

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

参考

参数

按钮:外部按钮

此按钮。

e:Ext.event.Event

点击事件。

希望这会对您有所帮助。

暂无
暂无

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

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