jstree inline HTML demo
by PeteLopez
HTML
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jstree/3.0.4/themes/default/style.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jstree/3.0.4/jstree.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<div id="container"></div>
JavaScript
$('#container').jstree({
'core': {
'data': [{
"text": "Root node",
"state": {
"opened": true
},
"type": "file",
"children": [{
"text": "Child node 1",
"type": "file",
"icon": ""
}, {
"text": "Child node 2",
"type": "file",
"icon": null
}, {
"text": "Child node 2",
"type": "file",
"icon": undefined
}, {
"text": "Child node 2",
"type": "file",
"icon": "glyphicon glyphicon-file"
}]
}]
},
'plugins': ['types'],
'types': {
"file": {
"icon": 'glyphicon glyphicon-file'
}
}
});