JS Tree Example JSON Data

Size
2,435 Kb
Views
91,080

How do I make an js tree example json data?

JS Tree Example JSON Data. What is a js tree example json data? How do you make a js tree example json data? This script and codes were developed by Dzulfikar Adi Putra on 06 September 2022, Tuesday.

JS Tree Example JSON Data Previews

JS Tree Example JSON Data - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>JS Tree Example JSON Data</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css'>
<link rel='stylesheet prefetch' href='https://static.jstree.com/3.0.9/assets/dist/themes/default/style.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container">
<div class="row"> <!-- Button trigger modal --> <h2>JS Tree Example JSON Data</h2> <small>by @superpikar</small><br/><br/> <p>this sample JS tree use JSON data, read the docs <a href="https://www.jstree.com/docs/json/" target="_blank">here </a></p> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"> Launch demo modal </button> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> <div class="container"> <div class="row"> <div id="jstree-tree" class="well col-sm-3"></div> <div id="jstree-result" class="col-sm-6">this is result</div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>
</div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jstree/3.0.9/jstree.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

JS Tree Example JSON Data - Script Codes CSS Codes

.container { margin-top: 20px;
}

JS Tree Example JSON Data - Script Codes JS Codes

var jsonData = [ { id : 1, text : "Folder 1", state : { selected : false }, children : [ { id : 2, text : "Sub Folder 1", state : { selected : false }, }, { id : 3, text : "Sub Folder 2", state : { selected : false }, } ] }, { id: 4, text : "Folder 2", state : { selected : true }, children : [] }
];
$('#jstree-tree') .on('changed.jstree', function (e, data) { var objNode = data.instance.get_node(data.selected); $('#jstree-result').html('Selected: <br/><strong>' + objNode.id+'-'+objNode.text+'</strong>'); }) .jstree({ core: { data: jsonData }
});
JS Tree Example JSON Data - Script Codes
JS Tree Example JSON Data - Script Codes
Home Page Home
Developer Dzulfikar Adi Putra
Username superpikar
Uploaded September 06, 2022
Rating 3
Size 2,435 Kb
Views 91,080
Do you need developer help for JS Tree Example JSON Data?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Dzulfikar Adi Putra (superpikar) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!