前台autoForm控件的只读和隐藏

在页面设计开发中,我们可能需要对AutoForm进行设置或者更改,但是因为在客户端并没有AutoForm对象,所以没有办法直接可以使用AutoForm对象进行操作,如果要对AutoForm进行处理方法如下:
AutoForm中有Group,Group中又可以有Label,TextdEitor,Label,Element Renderer等。


 

我们一般情况下对AtuoForm中的对象进行操作,有隐藏/只读两种。
1.Group
FormGroup的id的生成规则是:AutoForm ID_group+index,其中index为Group的顺序,从0开始。
比如该示例的第二个FormGroup的ID是formEmployee_group1

其它group可以自己命名,访问的时候可以用autoForm名_group名。

2.Label,TextEditor,Label,Element Renderer等
FieldLabel的ID为: formName_fieldlabel_fieldName
TextEditor以及CheckBox的ID为: formName_eidtor_fieldName
Label的ID为:formName_label_fieldName
Element Renderer的ID为:formName_groupName_ElementName_renderer

然后对于group 或者Label,TextEditor,Label,Element Renderer的操作可以这样子

document.getElementById("formName_fieldlabel_fieldName").style.display="none"//隐藏(一般fieldlabel和eidtor都要隐藏)

document.getElementById("formEmployee_group1").style.display="block"//显示

document.getElementById("formName_eidtor_fieldName").setReadOnly(true);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值