File tree Expand file tree Collapse file tree 1 file changed +37
-2
lines changed Expand file tree Collapse file tree 1 file changed +37
-2
lines changed Original file line number Diff line number Diff line change 1
1
yii2-bootstrap-tree
2
2
===================
3
- Виджет основыный на [ bootstrap-treeview] ( https://github.com/patternfly/patternfly-bootstrap-treeview )
3
+ Widget for [ bootstrap-treeview] ( https://github.com/patternfly/patternfly-bootstrap-treeview )
4
4
5
5
Installation
6
6
------------
@@ -28,17 +28,52 @@ Usage
28
28
Once the extension is installed, simply use it in your code by :
29
29
30
30
``` php
31
+
32
+ <?php
33
+ // Example of data. $items structure https://github.com/jonmiles/bootstrap-treeview#data-structure
34
+ $items = [
35
+ [
36
+ 'text' => 'Node 1'
37
+ 'icon' => "glyphicon glyphicon-stop",
38
+ 'selectedIcon' => "glyphicon glyphicon-stop",
39
+ 'href' => "#node-1",
40
+ 'selectable' => true,
41
+ 'state' => [
42
+ 'checked' => true,
43
+ 'disabled' => true,
44
+ 'expanded' => true,
45
+ 'selected' => true
46
+ ],
47
+ 'tags' => ['available'],
48
+ ...,
49
+ 'nodes'=>
50
+ [
51
+ ...
52
+ ]
53
+ ],
54
+ [
55
+ 'text' => 'Folder 2',
56
+ 'nodes' => [
57
+ ['text' => 'Node 2.1'],
58
+ ['text' => 'Node 2.2']
59
+ ]
60
+ ]
61
+ ];
62
+ ?>
63
+
31
64
<?= \lesha724\bootstraptree\TreeView::widget([
32
65
'htmlOptions'=>[
33
66
'id'=>'treeview-tabs'
34
67
],
35
68
'options'=>[
36
- 'data'=>$items,
69
+ //https://github.com/patternfly/patternfly-bootstrap-treeview#options
70
+ 'data'=>$items, // $items structure https://github.com/patternfly/patternfly-bootstrap-treeview#data-structure
37
71
'enableLinks'=>true,
38
72
'showTags'=>true,
39
73
'levels'=>3
40
74
],
41
75
'events'=>[
76
+ //https://github.com/patternfly/patternfly-bootstrap-treeview#events
42
77
'onNodeSelected'=>'function(event, data) {
43
78
// Your logic goes here
44
79
alert(data.href);
You can’t perform that action at this time.
0 commit comments