gpt4 book ai didi

javascript - 创建 ExtJs 扩展类

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:49:48 25 4
gpt4 key购买 nike

我尝试像在 sencha 中那样扩展 Button example .
我做fiddle
并得到错误:TypeError: this.addEvents is not a function : 'statesave'
怎么了?

最佳答案

您刚刚忘记调用 new 并且打错字了,请参阅 JSFiddle

PuffButton = Ext.extend(Ext.Button,{
constructor: function(config){
PuffButton.superclass.constructor.apply(this,arguments);
console.log("111111");
this.on('click',function(){this.el.puff();},this);
}
});
var puff = new PuffButton({text: 'Puff', renderTo:Ext.getBody()});

关于javascript - 创建 ExtJs 扩展类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17206931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com