Reference Source
public class | source

TreeView

Extends:

L~L.Evented → TreeView

Represents a ui TreeView

See:

Constructor Summary

Public Constructor
public

constructor(id: String, options: Object)

Constructor

Method Summary

Public Methods
public

clear(): Null

Remove all nodes

public

Return the number of nodes

public

Return node with a given key or null if not found

public

reload(source: Array): $.Promise

����ͼ�ؼ����¼�������Դ

public

Call fn(node) for all nodes

Public Constructors

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

Constructor

Params:

NameTypeAttributeDescription
id String

treeview id

options Object

config params

options.checkbox Boolean

display checkboxes to allow selection (default: false)..

options.imagePath String

path to a folder containing icons (default: null, using 'skin/' subdirectory).

options.selectMode Number

1:single, 2:multi, 3:multi-hier (default: 2).

options.source Array

used to initialize the tree.

Emit:

click

fired when an item is clicked by the user. (Events are called like this: CALLBACK_NAME(event, data))

select

fired when an item is (de)selected by the user. (Events are called like this: CALLBACK_NAME(event, data))

Public Methods

public clear(): Null source

Remove all nodes

Return:

Null

public count(): Number source

Return the number of nodes

Return:

Number

public getNodeByKey(key: String): TreeViewNode source

Return node with a given key or null if not found

Params:

NameTypeAttributeDescription
key String

the node's key

Return:

TreeViewNode

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

����ͼ�ؼ����¼�������Դ

Params:

NameTypeAttributeDescription
source Array

�µ�����Դ

Return:

$.Promise

public visit(fn: Function): Boolean source

Call fn(node) for all nodes

Params:

NameTypeAttributeDescription
fn Function

the callback function

Return:

Boolean