API
Component

Tree ($UI/system/components/justep/tree/tree)

使用范围:UI2

Contents

component Tree ($UI/system/components/justep/tree/tree) extends List

Tree

Constructor Top

  Tree ()
  Tree ( options)

Properties Top

string rootLabel

tree根节点名

Attributes Top

string class

组件class

string labelColumn

导航中显示的列

string rootLabel

tree根节点名

string xid

组件标示

Methods Top

Object get (String name)
Breadcrumb getBar ()
void set (json arg)

Events Top

void onBeforeLoadChildren (BeforeLoadChildrenEvent event)
void onCustomLoadChildren (CustomLoadChildrenEvent event)

Constructor details Top

public Tree ()

Tree

public Tree ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Properties Detail Top

public string rootLabel

tree根节点名

Attributes Detail Top

public string class

组件class

	
		基础样式: x-tree(必须)
		其他: x-inner-scroll(list内部出滚动条样式,不使用此class根据内容自增长)
		
		内部其他class说明:
		x-tree-template:标示对应节点下的内容是模板,会根据data数据进行生成显示
		x-tree-link:切换树的节点,点击后进入子节点
	

public string labelColumn

导航中显示的列

public string rootLabel

tree根节点名

public string xid

组件标示

Methods Detail Top

public Object get (String name)

获取属性值

Parameters

String name

属性名称,取值范围:"limit"、"filter"、"rootLabel"

Return Value

Object

public Breadcrumb getBar ()

获取导航的Breadcrumb组件

Return Value

Breadcrumb

public void set (json arg)

设置属性值

Parameters

json arg

属性值对
结构如下:

{ "limit" : {integer} 一次显示数据条数,==-1时感知data数据,data有多少数据显示多少数据,默认:-1 "filter: {string} 过滤条件表达式,表达式中可以使用$model,$object,$parent,$row(执行过滤的数据行对象)变量 "rootLabel" {string} tree根节点名 }

Return Value

void

Events Detail Top

public void onBeforeLoadChildren (BeforeLoadChildrenEvent event)

[回调型事件]加载子数据前,可以设置cancel=true禁止加载

Parameters

BeforeLoadChildrenEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 "row" : 当前行对象 "data" : data组件对象 "cancel" : 忽略加载 }

Return Value

void

public void onCustomLoadChildren (CustomLoadChildrenEvent event)

[回调型事件]自定义加载子数据

Parameters

CustomLoadChildrenEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 "row" : 当前行对象 "data" : data组件对象, "async" : 标识是否异步加载数据, "asyncCallBack" : 如果是异步加载数据,数据加载成功后调用回调 }

Return Value

void