Initialization
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:
- Include source files
- Create a container
- Initialize DataView with the object constructor
- Load data into DataView
<!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
<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":
<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.
// creating DHTMLX DataView
const dataview = new dhx.DataView("dataview_container", {
itemsInRow: 5
});
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.