Tree
Class name
E.controls.tree
(0.1.0)
Methods
Method | Parameters | Returns | Description | Example |
---|---|---|---|---|
build | string | Build string of component markup | build() |
|
append | jquery selector | boolean | Build and append string to DOM | append('#mydiv') |
child | any buildable | this |
Add content to component | child('Hello world') |
branch | label, instance of tree |
this |
Add branch label and tree instance | branch('Animal',myBranch) |
Usage
Create instance of control
var t = $E('tree');
Add simple item
t.child('Item A');
Create branch item
var t1 = $E('tree');
t1.child('Item B 1');
t1.child('Item B 2');
// add to main tree
t.branch('Item B',t1);
Append to DOM
t.append('body');
Last modified: 2016-02-19