ExtJS 中 setValue不显示的问题
{
xtype: 'textfield', emptyText: '标题', id: 'db', name: 'title', width: '100%', anchor: '100%', fieldLabel: '标题', hideLabel: true, allowBlank: false }
设定其里面的内容,
Ext.getCmp('db').setValue('www');
可是执行上面这条语句并不见效果,但是能看到
因为你的控件还没有被渲染出来,如果是在form中加载的, 需要用form的afterrender( Ext.Component this, Object eOpts )这个事件,就可以了.
var taskInfoForm = Ext.widget('form', {
id: 'taskInfoForm',
layout: 'vbox',
title:'对对对',
autoScroll:true,
bodyBorder: 0,
fieldDefaults: {labelAlign:'right', labelWidth:100},
defaults: {margins: '5 0 0 0'},
listeners: {
afterrender:function (_this, eOpts) {
_this.getForm().findField('db').setValue('eee');
}
}
//..............
});
ExtJS 中 setValue不显示的问题
最新推荐文章于 2018-07-06 15:08:00 发布