Reference Source
public class | source

TreeView

Extends:

L~L.Evented → TreeView

树视图控件

See:

Constructor Summary

Public Constructor
public

constructor(id: String, options: Object)

构造函数

Method Summary

Public Methods
public

activeNode(key: String): FancytreeNode

设置图层树关联的MapView

public

clear(): Null

清空所有节点

public

返回节点的数目

public

返回键值标识的节点(如果没有找到,返回null)

public

reload(source: Array): $.Promise

树视图控件重新加载数据源

public

subItemsLazyLoadFn(lazyLoadFn: *)

public

遍历树视图控件的所有节点

Public Constructors

public constructor(id: String, options: Object) source

构造函数

Params:

NameTypeAttributeDescription
id String

控件的id

options Object

配置参数

options.checkbox Boolean

显示复选框,允许选中节点(默认值:false)

options.imagePath String

包含图标的文件夹的路径 (默认值:null).

options.selectMode Number

1:single, 2:multi, 3:multi-hier (默认值: 2).

options.source Array

树视图绑定的数据源

Emit:

click

当用户单击某个节点时触发(回调函数的格式: CALLBACK_NAME(event, data))

select

当用户选择或者取消选择某个节点时触发(回调函数的格式: CALLBACK_NAME(event, data))

Public Methods

public activeNode(key: String): FancytreeNode source

设置图层树关联的MapView

Params:

NameTypeAttributeDescription
key String

node的key值

Return:

FancytreeNode

public clear(): Null source

清空所有节点

Return:

Null

public count(): Number source

返回节点的数目

Return:

Number

节点的数目

public getNodeByKey(key: String): TreeViewNode source

返回键值标识的节点(如果没有找到,返回null)

Params:

NameTypeAttributeDescription
key String

节点的键值

Return:

TreeViewNode

public reload(source: Array): $.Promise source

树视图控件重新加载数据源

Params:

NameTypeAttributeDescription
source Array

新的数据源

Return:

$.Promise

public subItemsLazyLoadFn(lazyLoadFn: *) source

Params:

NameTypeAttributeDescription
lazyLoadFn *

public visit(fn: Function): Boolean source

遍历树视图控件的所有节点

Params:

NameTypeAttributeDescription
fn Function

回调函数

Return:

Boolean