usable range
process
cms
portal
example
//可以在脚本中获取该组件
//方法1:
var view = this.form.get("fieldid"); //获取组件
//方法2
var view = this.target; //在组件本身的脚本中获取
source
members
viewmwf.xapplication.query.query.viewer
view组件,平台使用该组件实现视图的功能
type
example
//可以在脚本中获取该组件
var view = this.form.get("fieldid").view; //获取组件对象
source
nodeelement
组件的节点,mootools封装过的dom对象,可以直接使用原生的js和moootools方法访问和操作该对象。
type
-
element
example
//可以在脚本中获取该组件
var field = this.form.get("fieldid"); //获取组件对象
field.node.setstyle("font-size","12px"); //给节点设置样式
source
jsonjsonobject
组件的配置信息,比如id,类型,是否只读等等。可以在组件的queryload事件里修改该配置来对组件做一些改变。
type
-
jsonobject
inherited from
example
//可以在脚本中获取该组件
var json = this.form.get("fieldid").json; //获取组件对象
var id = json.id; //获取组件的id
var type = json.type; //获取组件的类型,如textfield 为文本输入组件,select为下拉组件
//在组件queryload事件里设置组件只读。
//当前组件的queryload事件运行时还没有在form里注册,通过this.form.get("fieldid")不能获取到当前组件,需要用this.target获取。
var json = this.target.json;
json.isreadonly = true; //设置组件为只读。
source
formmwf.xapplication.process.xform.form
组件的所在表单对象.
type
inherited from
example
var form = this.form.get("fieldid").form; //获取组件所在表单对象
var container = form.container; //获取表单容器
source
parentlinemwf.xapplication.process.xform.datatemplate.line|mwf.xapplication.process.xform.datatablepc.line|mwf.xapplication.process.xform.datatablemobile.line
当前组件在数据表格或者数据模板中时,可以通过此属性获取所在行(条目)对象.
type
-
mwf.xapplication.process.xform.datatemplate.line
|mwf.xapplication.process.xform.datatablepc.line
|mwf.xapplication.process.xform.datatablemobile.line
inherited from
example
//获取当前组件所在数据模板/数据表格的行(条目)对象
var line = this.target.parentline;
//获取当前字段所在行下标
var index = line.getindex();
//获取当前字段所在条目的subject字段的值
var data = line.getmodule("subject").getdata();
//设置当前字段所在条目的subject字段的值
line.getmodule("subject").setdata("test1");
source
methods
reload()
summary
重新加载视图
example
this.form.get("fieldid").reload()
source
active()
summary
当视图被设置为延迟加载(未立即载入),通过active方法激活
example
this.form.get("fieldid").active()