You have created the desired design. What should you do now? How can you use it in a real app?
Here is a small guide describing your further steps.
1. Download DHTMLX code files
To use the created design in an app you should include code files of the related DHTMLX components on your HTML page. If you have dealed with many components it would be a long list. So we recommend you to use 'dhtmlxSuite' package (you can download it here) as an alternative to standalone components. In case of the 'suite' you need to include just 2 files - dhtmlx.js and dhtmlx.css.
After you have downloaded the package you should unzip its content to the [YOUR APPLICATION ROOT]/codebase folder.
If it's your first encounter with the library or you have any problem at this stage, please, refer to
the basic start tutorial Your First App.
2. Create an HTML file
In the root folder of your application create a file 'index.html' with the following initial code:
<!DOCTYPE html>
<head>
<script src="../codebase/dhtmlx.js" type="text/javascript"></script>
<link rel="STYLESHEET" type="text/css" href="../codebase/dhtmlx.css">
<style> /*these styles allow Layout to work in Full Screen mode correctly in any browser*/
html, body {
width: 100%;
height: 100%;
margin: 0px;
overflow: hidden;
background-color:white;
}
</style>
<script type="text/javascript"> window.onload = function(){
//Here you'll put code of your application
}
</script>
</head>
<body>
</body>
</html>
Here your actions will depend on the version of Visual Designer you are using: desktop or online.
To integrate the design:
To integrate the design:
Now, regardless of the version you are using the <head> block of your HTML file will look as follows:
<head>
<script src="../codebase/dhtmlx.js" type="text/javascript"></script>
<link rel="STYLESHEET" type="text/css" href="../codebase/dhtmlx.css">
<style> /*these styles allow Layout to work in Full Screen mode correctly in any browser*/
html, body {
width: 100%;
height: 100%;
margin: 0px;
overflow: hidden;
background-color:white;
}
</style>
<script type="text/javascript"> window.onload = function(){
dhtmlx.image_path='./codebase/imgs/';
var main_layout = new dhtmlXLayoutObject(document.body, '2U');
var a = main_layout.cells('a');
var tree_1 = a.attachTree();
tree_1.setIconsPath('./codebase/imgs/');
tree_1.load('./data/tree.xml');
...
}
</script>
</head>
That's all. Now you can run the HTML page and see the design inside of an app.
Back to top