`

ExtJS中动态设置TextField的readOnly属性

阅读更多
1、假设 textField, 它的 id = 'textField'
则代码如下:Ext.getCmp("textField").getEl().dom.readOnly = true;

2、假设 textField, 通过 var textField = newExt.form.TextField()
则代码如下:textField.el.dom.readOnly = true;
分享到:
评论
7 楼 zxjlwt 2016-01-14  
学习了。
http://surenpi.com
6 楼 52p9_xu 2015-06-30  
asasdasda
5 楼 52p9_xu 2015-06-30  
[color=yellow][/color]
4 楼 niuhea 2012-08-30  
good!!!
3 楼 yangbao50213 2012-01-04  
可以不错,谢谢
2 楼 qixiaopeng 2010-07-14  
atian25 写道
3.2.0后直接有了
Field
setReadOnly( Boolean readOnly ) : void
Sets the read only state of this field.
Parameters:
    * readOnly : Boolean
      Whether the field should be read only.
Returns:
    * void


Thanks
I used 2.0 version when I wrote this blog.
1 楼 atian25 2010-07-12  
3.2.0后直接有了
Field
setReadOnly( Boolean readOnly ) : void
Sets the read only state of this field.
Parameters:
    * readOnly : Boolean
      Whether the field should be read only.
Returns:
    * void

相关推荐

    Ext Extjs 禁止文本和日期编辑

    在上述代码中,我们首先创建了一个`TextField`实例,并设置了其`readOnly`属性为`true`,这使得用户不能在文本框中输入或修改文本。你可以根据业务逻辑在合适的时间调用`setReadOnly`方法来切换文本框的可编辑状态。...

    extjs,表单学习

    在示例中,`new Ext.form.ComboBox()` 创建了一个ComboBox,`transform`属性关联了页面上的select元素,`width`设置了宽度,`triggerAction`定义了触发下拉列表的行为,`readOnly`设为true使得ComboBox只读,`...

    ExtAspNet_v2.3.2_dll

    -Grid的BoundField增加NullDisplayText属性,用于处理数据库中的null值,如果没有设置则默认为空字符串。 -修正DatePicker中的一个bug(31/01/2010将会返回NULL)使用DateFormatString来生成SelectedDate属性...

    ExtAspNet v2.2.1 (2009-4-1) 值得一看

    -为所有的表单字段增加AJAX属性ReadOnly(feedback:skydb)。 -Grid中TemplateField生成到页面中控件具有唯一ID,例如Grid1_ct5_Label2,Grid1_ct6_Label2(feedback:geruger)。 +2009-09-27 v2.1.2 -为Tree控件...

    基于extjs的.NET3.5控件Coolite 1.0.0.34580(Preview预览版)

    基于extjs的.NET3.5控件Coolite 1.0.0.34580 (Preview预览版), *************************************************** * Version 1.0.0 升级日志 * *************************************************** 1. ...

    EXT时间控件的扩展

    可动态显示年月,年月日,年月日时分,具体用法:{ xtype : 'textfield', anchor : '90%', fieldLabel:"生效时间" + CONSTANT.RED_FONT, allowBlank: false, name : ...

Global site tag (gtag.js) - Google Analytics