Skip to main content

Initialization

info

Download the DHTMLX Toolbar package as part of the DHTMLX Suite library.

Follow these steps to add DHTMLX Toolbar to an application:

<!DOCTYPE html>
<html>
<head>
<title>How to Start with DHTMLX Toolbar</title>
<script type="text/javascript" src="../../codebase/suite.js"></script>
<link rel="stylesheet" href="../../codebase/suite.css">
</head>
<body>
<div id="toolbar_container"></div>
<script>
// creating DHTMLX Toolbar
const toolbar = new dhx.Toolbar("toolbar_container");
</script>
</body>
</html>

Include source files​

Unpack the downloaded package into your project folder.

Create an HTML file and add the full paths to the JS and CSS files of the DHTMLX Suite library in its header. The files are:

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

Create a container​

Add a container for Toolbar and give it an id, for example toolbar_container:

<div id="toolbar_container"></div>

Initialize Toolbar​

Initialize Toolbar with the dhx.Toolbar object constructor. The constructor takes two parameters:

const toolbar = new dhx.Toolbar("toolbar_container", {
// config options
});

Configuration properties​

The Toolbar API overview article describes the properties you can specify to adapt Toolbar to your needs.

Load data into Toolbar​

The Data loading article explains how to load data into DHTMLX Toolbar.

Example​