Skip to main content

Initialization

info

Download the DHTMLX DataView package as a part of the DHTMLX Suite library

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

index.html
<!DOCTYPE html>
<html>
<head>
<title>How to start with DHTMLX DataView</title>
<script type="text/javascript" src="../../codebase/suite.js"></script>
<link rel="stylesheet" href="../../codebase/suite.css">
</head>
<body>
<div id="dataview_container"></div>
<script>
// creating DHTMLX DataView
const dataview = new dhx.DataView("dataview_container", {
itemsInRow: 5
});
</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 the DHTMLX Suite library into the header of the file. The files are:

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

Create a container

Add a container for DataView and give it an id, for example "dataview_container":

index.html
<div id="dataview_container"></div>

Initialize DataView

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

  • the HTML container for DataView,
  • optional, an object with configuration properties. If this argument is not passed to the constructor, the settings will be default.
index.js
// creating DHTMLX DataView
const dataview = new dhx.DataView("dataview_container", {
itemsInRow: 5
});
info

To display data in DataView you should define a template via the template configuration property.

Another way to display data in DataView is to prepare a data set with the "value" attribute.

Configuration properties

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

The detailed information on DataView configuration options can be found in the Dataview API overview article.

Load data into DataView

Detailed information on how to load data into DHTMLX DataView is given in the Data loading article.

Example