To initialize dataselect, you need to
There are five files that need to be included
<script src="../../codebase/dhtmlxdataview.js" type="text/javascript"></script> <script src="../../codebase/ext/linkpanel.js" type="text/javascript"></script> <script src="../../codebase/ext/dhtmlx/dataselect.js" type="text/javascript"></script> <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxdataview.css"> <link rel="STYLESHEET" type="text/css" href="../../codebase/ext/dhtmlxdataselect.css">
There is no need to set sizes for HTML container of the DataSelect. The size will be set automatically, depending on width and height of the DataView item.
<div id="select_container"></div>
To initilize DataSelect you need to pass an object with “container” and “view” elements. The other elements are not obligatory.
var selector = new dhtmlXDataSelect({ empty : "click here to select value", value : "#id#", template: "<span class='dhx_strong'>#Maintainer#</span>", container:"select_container", view:{ type:{ template:"<span class='dhx_strong'>#Maintainer#</span>#Package# <span class='dhx_light'>#Version#</span>", height:35 } } });
Elements of the dhtmlXDataSelect constructor:
DataView object is accessible by selector.config.view. So, data can be loaded using load method of the DataView:
selector.config.view.load("../common/data.xml");