List Usage Example

HTML code

listExample.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
	<head>
	<link rel="stylesheet" href="../../../codebase/touchui.css" type="text/css" media="screen" charset="utf-8">
		<script src="../../../codebase/touchui.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
              <script type="text/javascript" charset="utf-8">
 
	      dhx.ui({// creates a view and a popup within it
	            height: 300,// the height of the popup
	            view:"popup",
	            body:{ view:"list", id:"mylist", url:"xml/types.xml", datatype:"xml", // specifies a list component 
			  template:"#name#", select:true, type: { width: 300 }
		    }
              });    
	      </script>
 
	</body>
</html>

XML structure

types.xml

<?xml version="1.0" encoding="UTF-8"?>
<data total_count="6">
  <item id="1">
    <name><![CDATA[Cell Phones & PDAs]]>></name>
  </item>
  <item id="2">
    <name><![CDATA[DVDs & Movies]]></name>
  </item>
  <item id="3">
    <name><![CDATA[Computers & Networking]]></name>
  </item>
  <item id="4">
    <name><![CDATA[Cameras & Photo]]></name>
  </item>
  <item id="5">
    <name><![CDATA[Books]]></name>
  </item>
  <item id="6">
    <name><![CDATA[Musical Instruments]]></name>
  </item>
</data>
</xml>