在ext2.0中,创建FormPanel的时候,
如果直接在config options中直接给某个textField赋配置项readOnly: true,这样是可以使textfield只读,但是我想在创建了FormPanel之后,再根据具体情况给这个textfield配置是否只读
我试过在之后通过formPanel的findById()获得这个textField,然后设置textfield.readOnly = true
并且alert(textfield.readOnly),显示值已经变成了true,但是在组件上并没有体现,还是可编辑
小弟是ext新手,请问应该如何设置,并说说其中的原理
如何在创建FormPanel之后,设置textField组件只读?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- TideLeeLiveCom 2008-10-15 22:34关注
textfield.getEl().dom.readOnly = true;
因为:
readOnly : Boolean
True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报