As initial data we'll take 3 books:
In JSArray the data will look as:
books.js
[ ["War and Peace", "Leo Tolstoy" ], ["Hamlet", "Shakespeare" ], ["Madame Bovary", "Gustave Flaubert" ] ]
Data in JS array hasn’t got names for values. Values are accessible as (“data0”, “data1”, …):
list(jsarray).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"> var books = [ ["War and Peace", "Leo Tolstoy" ], ["Hamlet", "Shakespeare" ], ["Madame Bovary", "Gustave Flaubert" ] ] dhx.ui({ view:"list", data:"books", datatype:"jsarray", template:"#data0# (#data1#)", select:true, type: {width: 300} }); </script> </body> </html>
If you use data from external file - remove the data parameter and add url, where specify the desired data file.
dhx.ui({ view:"list", url:"books.js", datatype:"jsarray", template:"#data0# (#data1#)", select:true, type: {width: 300} });