dorado获取表单数据的方式?!

方式一 :
通过使用AutoFormElement的ID获取他们的值,实现Button的onClick事件:
1 var value = this.get("#AutoFromElementId.value");
2 dorado.MessageBox.alert(value);
设置数据方式 
1 this.set("#autoFormElementId.value","设置数据");
方式二 :
为AutoForm添加id属性,此处是form1,实现Button的onClick事件:
1 var entity = this.get("#form1.entity");
2 dorado.MessageBox.alert(entity.name属性值或者property属性值);
通过autoForm的Entity属性获取所有form中的所有数据并以JSON形式保存在Entity中。默认情况下Entity中存储数据的key值使用每一个AutoFormElement的name属性。另,如果设定了AutoFormElement的property属性,那么Key将使用property属性设定的值。
设置数据方式
1 this.set("#autoForm1.entity",
2     {e1:"设置数据"});
3 
其中autoForm1是AutoForm中的id属性,e1是AutoFormElement中name属性或者property属性,采用JSON格式。
posted on 2015-04-25 09:28  _故乡的原风景  阅读(548)  评论(0编辑  收藏  举报