API
Class

XuiDoc ($UI/system/components/designerCommon/js/xuiService#xuiDoc)

使用范围:UI2

Contents

class XuiDoc ($UI/system/components/designerCommon/js/xuiService#xuiDoc)

xui文档对象

Constructor Top

  xuiDoc ()

Static Methods Top

void batchCreateComponent (Object[] configs, function callBack)
void batchSetCSS (String[] d_ids, Object cssConfig)
void createComponent (String componentName, Object parent, Object options, function callBack)
void deleteComponent (Object[] comObjOrIds, Object options, function callBack)
String genaXId (String componentName)
Object get (Object comObjOrId, String propName)
Object getAllOperations ()
String getFilePath ()
String getNodeByDId (String did)
String getTemplate (String componentName)
void getXuiService (String[] d_ids, Object cssConfig)
void move (Object comObjOrDId, Object targetParentObjOrDId, Object beforeObjOrId, function callBack)
void repaintComponent (Object comObjOrDId, function callBack)
void replaceChild (Object comObjOrDId, String childTemplate, Object options, function callBack)
String selectNodes (String xpath)
void set (Object comObjOrId, Object config, function callBack)
void setCSS (Object comObjOrDId, Object cssConfig)
void updateNodes (Object $htmlNodeList, String[] excludeProperties, Boolean isExclude, function callBack)
void updateProperties (Object $htmlNodeList, String[] properties, Boolean isExclude, function callBack)
void updateText (Object $htmlNodeList, Boolean isCDATA, function callBack)

Constructor details Top

public xuiDoc ()

xui文档对象

Static Methods Detail Top

static public void batchCreateComponent (Object[] configs, function callBack)

批量创建组件

	  
		var configs = [];
		for(var i=0;i<cols.length;i++){
			configs.push({
				componentName : "$UI/system/components/justep/grid/grid#column",
				parentElementId : self.columns_dId,
				templateContent : '<column width="100" name="'+cols[i]+'"/>'
			});
		}
		//批量创建列
		xuiDoc.batchCreateComponent(configs, function() {
			self.repaintGrid();
		});
				
	    

Parameters

Object[] configs

参数列表,单个参数项为componentName--组件注册名,parentElementId--父节点did,templateContent--模版内容

function callBack

回调函数

Return Value

void

static public void batchSetCSS (String[] d_ids, Object cssConfig)

批量设置css项

Parameters

String[] d_ids

目标节点的did列表

Object cssConfig

json格式的设置项,如:{width:"100px",height:"450px"}

Return Value

void

static public void createComponent (String componentName, Object parent, Object options, function callBack)

创建组件

	
	    xuiDoc.createComponent(componentName,pId,{paintComponent:paintComponent,templateContent:templateText},function(node){
		    	
		});
	

Parameters

String componentName

组件注册名

Object parent

父节点 字符串或者dom节点

Object options

json格式的可选参数,包含before--did 表示在这个id对应的元素之前插入、templateContent--模板内容、paintComponent--true/false 是否绘制当前创建的组件

function callBack

回调函数

Return Value

void

static public void deleteComponent (Object[] comObjOrIds, Object options, function callBack)

删除组件

Parameters

Object[] comObjOrIds

组件对象或者did列表

Object options

json格式的可选参数,包含paths--当前要删除节点的jquery查询路径

function callBack

回调函数

Return Value

void

static public String genaXId (String componentName)

生成全文档唯一的xid

Parameters

String componentName

组件注册名

Return Value

String

static public Object get (Object comObjOrId, String propName)

获取属性值

Parameters

Object comObjOrId

组件对象或者did

String propName

属性名

Return Value

Object

static public Object getAllOperations ()

获取所有组件的操作

Return Value

Object

static public String getFilePath ()

获取当前的w文件路径

Return Value

String

static public String getNodeByDId (String did)

根据设计时id获取模型节点

Parameters

String did

页面id

Return Value

String

返回目标节点的字符串格式

static public String getTemplate (String componentName)

获取组件模版内容

Parameters

String componentName

组件注册名

Return Value

String

static public void getXuiService (String[] d_ids, Object cssConfig)

获取xuiService对象

Parameters

String[] d_ids

目标节点的did列表

Object cssConfig

json格式的设置项,如:{width:"100px",height:"450px"}

Return Value

void

static public void move (Object comObjOrDId, Object targetParentObjOrDId, Object beforeObjOrId, function callBack)

移动组件节点

Parameters

Object comObjOrDId

组件对象或者did

Object targetParentObjOrDId

目标父组件对象或者d_id

Object beforeObjOrId

参考组件对象或者d_id --表示移动到组件之前

function callBack

回调函数

Return Value

void

static public void repaintComponent (Object comObjOrDId, function callBack)

重新绘制组件

Parameters

Object comObjOrDId

组件对象或者did

function callBack

回调函数

Return Value

void

static public void replaceChild (Object comObjOrDId, String childTemplate, Object options, function callBack)

替换子元素

Parameters

Object comObjOrDId

组件对象或者did

String childTemplate

子元素的模板内容

Object options

可选参数 包含:xpathCondition 查询子元素的xpath paintComponent 是否需要在界面上绘制这些子节点

function callBack

回调函数

Return Value

void

static public String selectNodes (String xpath)

根据xpath选择模型节点

Parameters

String xpath

标准的xpath表达式

Return Value

String

返回目标节点的字符串格式

static public void set (Object comObjOrId, Object config, function callBack)

设置属性值,支持同时设置多个

Parameters

Object comObjOrId

组件对象或者did

Object config

json格式的参数,如{name:'test'}

function callBack

回调函数

Return Value

void

static public void setCSS (Object comObjOrDId, Object cssConfig)

设置css项

Parameters

Object comObjOrDId

组件对象或者did

Object cssConfig

json格式的设置项,如:{width:"100px",height:"450px"}

Return Value

void

static public void updateNodes (Object $htmlNodeList, String[] excludeProperties, Boolean isExclude, function callBack)

把js端的dom节点内容更新到java模型中

Parameters

Object $htmlNodeList

jquery节点列表

String[] excludeProperties

排除那些属性不更新

Boolean isExclude

是否是排除属性

function callBack

回调函数

Return Value

void

static public void updateProperties (Object $htmlNodeList, String[] properties, Boolean isExclude, function callBack)

更新js端的dom节点属性值更新到java模型中对应的dom节点上

Parameters

Object $htmlNodeList

jquery节点列表

String[] properties

属性列表

Boolean isExclude

是否是排除属性

function callBack

回调函数

Return Value

void

static public void updateText (Object $htmlNodeList, Boolean isCDATA, function callBack)

把js端的dom节点文本更新到java模型对应的节点中

Parameters

Object $htmlNodeList

jquery节点列表

Boolean isCDATA

是否是包含在cdata中

function callBack

回调函数

Return Value

void