forked from nje/jquery-datalink
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo-contacts.html
72 lines (68 loc) · 2.53 KB
/
demo-contacts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Contacts - Linking Demo</title>
<link type="text/css" rel="Stylesheet" href="demo-contacts.css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.datalink.js"></script>
<script type="text/javascript" src="jquery.tmpl.js"></script>
<script type="text/javascript" src="demo-contacts.js"></script>
<script id="contacttmpl" type="text/html">
<tr>
<th> </th>
<th>First Name</th>
<th>Last Name</th>
<th>Phone Numbers</th>
<th>Age</th>
</tr>
{{each(i,contact) contacts}}
<tr class="contact">
<td>
<a href="#" class="contact-remove">remove</a><br/>
<a href="#" class="contact-reset">reset</a><br/>
</td>
<td>
<input name="firstName" class="contact" type="text" value="${firstName}" />
</td>
<td><input name="lastName" class="contact" type="text" value="${lastName}" /></td>
<td>
<table class="phones">
<tr>
<th> </th>
<th>Type</th>
<th>Number</th>
</tr>
{{each(i,city) phones}}
<tr class="phone">
<td><a href="#" class="phone-remove">remove</td>
<td><input class="phone phone-type" name="type" type="text" value="${type}" /></td>
<td><input class="phone phone-number" name="number" type="text" value="${number}" /></td>
</tr>
{{/each}}
</table>
<a href="#" class="newphone">add new phone</a>
</td>
<td>
<input type="text" class="agebar" name="age" value="${age}" />
</td>
</tr>
{{/each}}
</script>
</head>
<body>
<div>
This is a demo of the Data Linking feature being proposed by Microsoft. You can follow the discussion and provide feedback on the jQuery developer forum, here:
<br/><a href="http://forum.jquery.com/topic/proposal-for-adding-data-linking-to-jquery">jQuery Discussion</a>
<br/>
And you can view the source from here or keep up to date with it on github, here:
<br/><a href="https://github.com/nje/jquery-datalink/">DataLink on GitHub</a>
</div>
<table class="contacts">
</table>
<input type="button" id="insert" value="Insert new contact" />
<input type="button" id="sort" value="Sort by Last Name" />
<input type="button" id="save" value="Save contacts" />
<pre id="results">
</pre>
</body>
</html>