自定义组件ExtJS,而不是工作setValue
Custom component ExtJS, not work setValue
任何人,请帮助我为extjs 4.2 创建组件
Ext.define('mycomponent', {
extend:'Ext.form.field.Display',
alias: 'widget.mycomponent',
initComponent: function() {
this.setValue("some value") // not setup
this.callParent(arguments);
console.log(this)
},
})
我试试
Ext.getCmp(this.id).setValue("some")
但html对象不存在,e.t.c.之前的事件未运行。我如何设定价值?
这是一个完整的工作示例,用4.2.1进行了测试。
Ext.define('Foo', {
extend:'Ext.form.field.Display',
alias: 'widget.mycomponent',
initComponent: function() {
this.setValue("some value") // not setup
this.callParent(arguments);
}
})
Ext.onReady(function() {
new Foo({
renderTo: document.body
})
});
您需要在构造函数中定义getValue()和setValue()方法才能工作。
getValue: function () {
var me = this,
value;
return value;
}
setValue: function (value) {
var me = this;
// Example only should't work as it is
me.displayField.setValue(value);
}
相关文章:
- Javascript:selenium Web驱动程序isDisplayed()不工作
- jQuery UI自动完成突然停止工作
- AngularJS UI路由器不能像ng路由器那样工作
- HTML5音频加载和播放获胜'我不能在iPad上工作
- JavaScript打印功能使日历停止工作
- Javascript.getHours()工作不正常
- 为什么这在IE中的工作方式与在Firefox中不同
- 视频HTML没有'无法在Internet Explorer 11上工作
- 扩展移相器按钮类不工作
- Firebase迁移-简单的Firebase.set没有'不再工作了——旧的还是新的
- 谷歌地图不是以HTML显示,而是在JS Fiddle上工作
- 正在尝试使用if和else添加类,但无法正常工作
- Jquery FadeIn FadeOut 只工作一次
- Foreach无法在Typescript中工作
- 另一个ajax调用中的Jquery ajax调用在for循环中没有按预期工作
- 为什么不是't窗口.恢复正常工作吗?(javascript/jquery)
- JS可以在Chrome中工作,但不能在Firefox中工作
- ajaxToolkit PopupControlExtender不工作.过时的
- HTML标记在脚本标记中工作
- 自定义组件ExtJS,而不是工作setValue