February 2010
Beginner
400 pages
11h 13m
English
DataView binding can be carried out declaratively, programmatically, or via a mixture of the two. Let's look at declarative binding first.
In the first example, you will create an array of people consisting of a person's name and age and then bind it declaratively:
Add the following script block in the header of your page:
<script type="text/javascript">
Sys.require(Sys.components.dataView);
var people = [
{ Name: "Alex Mackey", Age: "28" },
{ Name: "Sharyn Mackey", Age: "35" },
{ Name: "Brett Chaney", Age: "33" },
{ Name: "Jenny Chia", Age: "24"}];
</script>
Now replace the <body> tag with the following HTML:
<body xmlns:dataview="javascript:Sys.UI.DataView"> <div id="peopleView" class="sys-template" ...