Extjs的Panel的Item没有改变

标签 extjs extjs4

我是 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/

相关文章:

extjs - 在 ExtJS 中,如何让 store.load(config) 发送不限于预定义的参数?

javascript - 使用 ExtJs 设置文件下载目标

javascript - EXT.JS 4.0.5 中的网格滚动问题,不考虑工具栏高度

javascript - ExtJS 4 菜单颜色选择器 (Ext.menu.ColorPicker) 中的 CustomColors 颜色

extjs - 将静态数据加载到 Ext.data.TreeStore

object - Ext.apply覆盖嵌套对象?

javascript - Extjs 4 - 为树面板创建模型

javascript - 加载局部 View 时调用 javascript

javascript - Extjs KeyMap 不作用于defaultEventAction,而是执行默认的浏览器操作

javascript - ExtJS 存储/代理不向服务器发送删除方法