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 11yii2-bootstrap-tree
22===================
3- Виджет основыный на [ bootstrap-treeview] ( https://github.com/patternfly/patternfly-bootstrap-treeview )
3+ Widget for [ bootstrap-treeview] ( https://github.com/patternfly/patternfly-bootstrap-treeview )
44
55Installation
66------------
@@ -28,17 +28,52 @@ Usage
2828Once the extension is installed, simply use it in your code by :
2929
3030``` 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+
3164<?= \lesha724\bootstraptree\TreeView::widget([
3265 'htmlOptions'=>[
3366 'id'=>'treeview-tabs'
3467 ],
3568 '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
3771 'enableLinks'=>true,
3872 'showTags'=>true,
3973 'levels'=>3
4074 ],
4175 'events'=>[
76+ //https://github.com/patternfly/patternfly-bootstrap-treeview#events
4277 'onNodeSelected'=>'function(event, data) {
4378 // Your logic goes here
4479 alert(data.href);
You can’t perform that action at this time.
0 commit comments