Check documentation for the latest version of dhtmlxSuite Initializing List DHTMLX Docs

Initializing List

To initialize List, you need to complete the following steps:

  1. include dhtmlx.js and dhxtml.css files
  2. place a container for a list on a page
  3. run the list initialization

Step 1. Including Necessary Files

To start working with dhtmlxList, you need to include List js/css files on a page.

In order to use dhtmlxList as a separate component, you need to include its source files on the page. There are two of them:

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

If you use dhtmlxList as a part of "dhtmlxSuite" package, you need to have 2 files included:

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

dhtmlxList .js/.css files are part of dhtmlx.js/.css, so there is no need to include them separately.

Including source files from CDN

To include JS/CSS files of "dhtmlxSuite" package from CDN, you should set direct links to dhtmlx.js and dhtmlx.css files:

<link rel="stylesheet" href="" 
<script src="" 

By setting links in this way you will get the latest version of dhtmlxSuite. To get some particular version, just specify the number of the required version in the link, like this:

<link rel="stylesheet" href="" 
<script src="" 

Step 2. Creating Container

HTML container for List must have some sizes specified:

<div id="data_container" style="width:320px;height:396px;"></div>

Step 3. Initializing List

As only the "container" is mandatory, you need to define the template and the source of data to see any result on a page:

myList = new dhtmlXList({
        template:"#Package# : #Version#<br/>#Maintainer#"
    Package:"test one",

Other possible parameters are given in the article Object Constructor.

Since the add command is not a mandatory part of initialization, you will not have any visible objects on the page before some data isn't loaded into a list by the load or add commands.

Related sample:  Initialization with auto height

Back to top