我是 Extjs4 的学生。
首先,请阅读此代码..这是我的面板项目。
var propertyItem = [{
xtype : 'textfield',
fieldLabel : 'Name',
name : 'objectName',
width : 380,
margin : '5 0 0 10',
value : 'text'
}, {
xtype : 'textfield',
fieldLabel : 'X',
name : 'objectX',
width : 380,
margin : '5 0 0 10'
}, {
xtype : 'textfield',
fieldLabel : 'Y',
name : 'objectY',
width : 380,
margin : '5 0 0 10'
}, {
xtype : 'textfield',
fieldLabel : 'Width',
name : 'objectWidth',
width : 380,
margin : '5 0 0 10'
}, {
xtype : 'textfield',
fieldLabel : 'Height',
name : 'objectHeight',
width : 380,
margin : '5 0 0 10'
}, {
xtype : 'textfield',
fieldLabel : 'Color',
name : 'objectColor',
width : 380,
margin : '5 0 0 10'
}, {
xtype : 'htmleditor',
fieldLabel : 'Custom',
name : 'objectCustom',
margin : '5 0 0 10',
width : 380,
height : 180
}];
我的面板代码是..
var propertyForm = Ext.create('Ext.form.Panel', {
region : 'center',
xtype : 'form',
title : 'Property',
items : propertyItem
});
之后,我改变了这一点,就像这样..
propertyItem[0].value = 'This is My Text';
但是,在浏览器中,这是无法更改的。
首先,该文本字段的值为 Test,
之后,该文本字段的值为“这是我的文本”,
但是,没有改变..
我可以为这个问题做什么?
对不起我的傻瓜英语..谢谢!
附注
如果你看不懂这篇文章,请评论我...
最佳答案
试试这个
propertyForm.items.items[0].setValue('This is My Text');
关于Extjs的Panel的Item没有改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9734811/