UNPKG

patternfly

Version:

This reference implementation of PatternFly is based on [Bootstrap v3](http://getbootstrap.com/). Think of PatternFly as a "skinned" version of Bootstrap with additional components and customizations.

234 lines (229 loc) 8.06 kB
<!DOCTYPE html> <!--[if IE 9]><html class="ie9"><![endif]--> <!--[if gt IE 9]><!--> <html> <!--<![endif]--> <head> <title>Bootstrap Tree View - PatternFly</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="shortcut icon" href="../dist/img/favicon.ico"> <!-- iPad retina icon --> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../dist/img/apple-touch-icon-precomposed-152.png"> <!-- iPad retina icon (iOS < 7) --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../dist/img/apple-touch-icon-precomposed-144.png"> <!-- iPad non-retina icon --> <link rel="apple-touch-icon-precomposed" sizes="76x76" href="../dist/img/apple-touch-icon-precomposed-76.png"> <!-- iPad non-retina icon (iOS < 7) --> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../dist/img/apple-touch-icon-precomposed-72.png"> <!-- iPhone 6 Plus icon --> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="../dist/img/apple-touch-icon-precomposed-180.png"> <!-- iPhone retina icon (iOS < 7) --> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../dist/img/apple-touch-icon-precomposed-114.png"> <!-- iPhone non-retina icon (iOS < 7) --> <link rel="apple-touch-icon-precomposed" sizes="57x57" href="../dist/img/apple-touch-icon-precomposed-57.png"> <link href="../dist/css/patternfly.min.css" rel="stylesheet" media="screen, print"> <link href="../dist/css/patternfly-additions.min.css" rel="stylesheet" media="screen, print"> <link href="tests.css" rel="stylesheet" media="screen, print"> <script src="../components/jquery/dist/jquery.min.js"></script> <script src="../components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="../components/bootstrap-treeview/dist/bootstrap-treeview.min.js"></script> <script src="../dist/js/patternfly.min.js"></script> </head> <body> <div class="container"> <div class="page-header"> <h1>Bootstrap Tree View</h1> </div> <div class="alert alert-warning"> <span class="pficon pficon-warning-triangle-o"></span> These examples are included for development testing purposes. For official documentation, see <a href="https://www.patternfly.org" class="alert-link">https://www.patternfly.org</a>, <a href="http://getbootstrap.com" class="alert-link">http://getbootstrap.com</a>, and <a href="https://github.com/jonmiles/bootstrap-treeview">https://github.com/jonmiles/bootstrap-treeview</a>. </div> <hr> <div class="row"> <div class="col-sm-4"> <h2>Default</h2> <div id="treeview1"></div> </div><!--/col--> <div class="col-sm-4"> <h2>Collapsed</h2> <div id="treeview2"></div> </div><!--/col--> <div class="col-sm-4"> <h2>Expanded</h2> <div id="treeview3"></div> </div><!--/col--> </div><!--/row--> <div class="row"> <div class="col-sm-4"> <h2>Link enabled</h2> <div id="treeview4"></div> </div><!--/col--> <div class="col-sm-4"> <h2>Events</h2> <div id="treeview5"></div> </div><!--/col--> <div class="col-sm-4"> <h2>Output</h2> <div id="event_output"></div> </div><!--/col--> </div><!--/row--> <div class="row"> <div class="col-sm-4"> <h2>JSON Data</h2> <div id="treeview6"></div> </div><!--/col--> <div class="col-sm-4"> <h2></h2> <div id="treeview13"></div> </div><!--/col--> <div class="col-sm-4"> <h2></h2> <div id="treeview14"></div> </div><!--/col--> </div><!--/row--> <script> $(function() { var defaultData = [ { text: 'Parent 1', href: '#parent1', tags: ['4'], nodes: [ { text: 'Child 1', href: '#child1', icon: 'fa fa-file-o', tags: ['2'], nodes: [ { text: 'Grandchild 1', href: '#grandchild1', icon: 'fa fa-file-o', tags: ['0'] }, { text: 'Grandchild 2', href: '#grandchild2', icon: 'fa fa-file-o', tags: ['0'] } ] }, { text: 'Child 2', href: '#child2', icon: 'fa fa-file-o', tags: ['0'] } ] }, { text: 'Parent 2', href: '#parent2', tags: ['0'] }, { text: 'Parent 3', href: '#parent3', tags: ['0'] }, { text: 'Parent 4', href: '#parent4', tags: ['0'] }, { text: 'Parent 5', href: '#parent5' , tags: ['0'] } ]; var json = '[' + '{' + '"text": "Parent 1",' + '"nodes": [' + '{' + '"text": "Child 1",' + '"nodes": [' + '{' + '"text": "Grandchild 1"' + '},' + '{' + '"text": "Grandchild 2"' + '}' + ']' + '},' + '{' + '"text": "Child 2"' + '}' + ']' + '},' + '{' + '"text": "Parent 2"' + '},' + '{' + '"text": "Parent 3"' + '},' + '{' + '"text": "Parent 4"' + '},' + '{' + '"text": "Parent 5"' + '}' + ']'; $('#treeview1').treeview({ collapseIcon: "fa fa-angle-down", data: defaultData, expandIcon: "fa fa-angle-right", nodeIcon: "fa fa-folder", showBorder: false }); $('#treeview2').treeview({ collapseIcon: "fa fa-angle-down", data: defaultData, expandIcon: "fa fa-angle-right", levels: 1, nodeIcon: "fa fa-folder", showBorder: false }); $('#treeview3').treeview({ collapseIcon: "fa fa-angle-down", data: defaultData, expandIcon: "fa fa-angle-right", levels: 99, nodeIcon: "fa fa-folder", showBorder: false }); $('#treeview4').treeview({ collapseIcon: "fa fa-angle-down", data: defaultData, enableLinks: true, expandIcon: "fa fa-angle-right", levels: 99, nodeIcon: "fa fa-folder", showBorder: false }); $('#treeview5').treeview({ collapseIcon: "fa fa-angle-down", data: defaultData, expandIcon: "fa fa-angle-right", levels: 99, nodeIcon: "fa fa-folder", showBorder: false, onNodeSelected: function(event, node) { $('#event_output').prepend('<p>You clicked ' + node.text + '</p>'); } }); $('#treeview6').treeview({ collapseIcon: "fa fa-angle-down", data: json, expandIcon: "fa fa-angle-right", levels: 99, nodeIcon: "fa fa-folder", showBorder: false }); }); </script> </div><!-- /container --> </body> </html>