A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.dhtmlx.com/suite/tree/initialization_of_dhtmlxtree/ below:

JavaScript Tree - Initialization | DHTMLX Suite 9 Docs

Initialization

To initialize DHTMLX Tree on a page, you need to take the following simple steps:

<!DOCTYPE html>
<html>
<head>
<title>How to Start with DHTMLX Tree</title>
<script type="text/javascript" src="../../codebase/tree.js"></script>
<link rel="stylesheet" href="../../codebase/tree.css">
</head>
<body>
<div id="tree_container"></div>
<script>

const tree = new dhx.Tree("tree_container",{

});
</script>
</body>
</html>
Include source files​

Unpack the downloaded package into a folder of your project.

After that, create an HTML file and place full paths to JS and CSS files of DHTMLX Tree into the header of the created file. The Tree component can be used standalone or as a part of the Suite library.

If you use DHTMLX Tree standalone, you need to include 2 files:

<script type="text/javascript" src="../../codebase/tree.js"></script>
<link rel="stylesheet" href="../../codebase/tree.css">

If you use DHTMLX Tree as a part of the Suite package, you need to include JS/CSS files of the dhtmlxSuite library:

<link type="text/css" href="../codebase/suite.css">
<script src="../codebase/suite.js" type="text/javascript"></script>
Create a container​

Add a container for Tree and give it an id, for example "tree_container":

index.html

<div id="tree_container"></div>
Initialize Tree​

Initialize Tree with the dhx.Tree object constructor. The constructor has two parameters:

index.js


const tree = new dhx.Tree("tree_container", {
checkbox: true
});
Configuration properties​

There is a set of properties you can specify for Tree to optimize its configuration for your needs.

See the detailed information on configuration properties of Tree in the Tree API overview article.

Load data into Tree​

Detailed information on loading data into Tree is given in the Data loading article.

Example​

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4