Field Sencha Touch上的Readonly财产

时间:2011-05-29 19:06:48

标签: field sencha-touch readonly

您好我一直在寻找secnhatouch中字段的readOnly属性但是还没找到它......有人可以帮我解决这个问题

{
                 xtype: 'textfield',
                 name: 'ReferenceNumber',
                 readOnly:true,
                 label: 'Reference'
}

3 个答案:

答案 0 :(得分:8)

我遇到同样的问题readOnly: true无法正常工作 - 我可以通过添加afterrender监听器来修复它:

{
    xtype: 'textfield',
    name: 'ReferenceNumber',
    label: 'Reference',
    listeners: {
        afterrender: function(ele) {
            ele.fieldEl.dom.readOnly = true;
        }
    }
}

答案 1 :(得分:2)

我想你想要禁用的字段

{
    xtype: 'textfield',
    name: 'ReferenceNumber',
    **disabled**: true,
    value: '12312421',
    label: 'Reference'
}

我重载了'disabledCls',因为它比我想要的更加灰色。

答案 2 :(得分:0)

我可以通过设置readOnly: nullreadOnly: undefined

来解决此问题
{
    xtype: 'textfield',
    name: 'Website',
    label: 'Website',
    readOnly: null
}
相关问题