Class
zebkit.ui.tree.Tree
extends <zebkit.ui.tree.BaseTree> |
<zebkit.ui.tree> |
Tree UI component that visualizes a tree data model. The model itself can be passed as JavaScript structure or as a instance of zebkit.data.TreeModel. Internally tree component keeps the model always as zebkit.data.TreeModel class instance:
var tree = new zebkit.ui.tree.Tree({
value: "Root",
kids : [ "Item 1", "Item 2"]
});
or
var model = new zebkit.data.TreeModel("Root");
model.add(model.root, "Item 1");
model.add(model.root, "Item 2");
var tree = new zebkit.ui.tree.Tree(model);
Tree model rendering is fully customizable by defining an own views provider. Default views provider renders tree model item as text. The tree node can be made editable by defining an editor provider. By default tree modes are not editable.
zebkit.ui.tree.Tree
([model], [b]
)
Parameters:
-
[model]
<Object | zebkit.data.TreeModel>a tree data model passed as JavaScript structure or as an instance
-
[b]
<Boolean>the tree component items toggle state. true to have all items in opened state.
private
|
<Boolean> | se (item, e) |
public | void | setEditorProvider (p) |
public | void | setModel (d) |
public | void | setViewProvider (p) |
protected
|
void | startEditing (item) |
protected
|
void | stopEditing (true) |
private
<Boolean>
se (item, e )
Initiate the given item editing if the specified event matches condition Parameters:
Returns:
<Boolean>
return true if an item editing process has been started, false otherwise |
public
void
setEditorProvider (p )
Set the given editor provider. The editor provider is a class that is used to decide which UI component has to be used as an item editor, how the editing should be triggered and how the edited value has to be fetched from an UI editor. Parameters:
|
@Override
zebkit.ui.tree.BaseTree
public chainable setModel (d )
Set the given tree model to be visualized with the UI component. Parameters:
|
public
chainable
setViewProvider (p )
Set tree component items view provider. Provider says how tree model items have to be visualized. Parameters:
|
protected
void
startEditing (item )
Start editing the given if an editor for the item has been defined. Parameters:
|
protected
void
stopEditing (true )
Stop editing currently edited tree item and apply or discard the result of the editing to tree data model. Parameters:
|
















public
![]() provider
A tree model items view provider |