Skip to content

Commit 2995f38

Browse files
committed
Use real data store for contacts.
git-svn-id: http://svn.dojotoolkit.org/src/demos/trunk@15363 560b804f-0ae3-0310-86f3-f6aa0a117693
1 parent 5a6f3e5 commit 2995f38

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

mail/contacts.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
identifier: 'email',
3+
label: 'display',
4+
items: [
5+
6+
<?php
7+
$counter = 0;
8+
$ext = array("@gmail.com", "@yahoo.com", "@dojotoolkit.org");
9+
$aFirst = array("Adam", "Alan", "Alex", "Bill", "Becky", "Bob", "Bruce", "Carol", "Chris", "Dave", "Ed", "Ellen", "Eugene", "Frank", "Fred", "Francis", "Glenn", "James", "Jane", "Joe", "Tom");
10+
$aLast = array("Arkin", "DeBois", "Jones", "Smith", "Pitt", "Arquette", "VanDeLay");
11+
foreach($aFirst as $first) {
12+
foreach($aLast as $last) {
13+
$name = $first . " " . $last;
14+
$email = strtolower($first) . "." . strtolower($last) . $ext[$counter%3];
15+
$display = $name . " <" . $email . ">";
16+
print "{ " .
17+
"name: '" . $name . "',\n" .
18+
"email: '" . $email . "',\n" .
19+
"display: '" . $display . "'\n" .
20+
"},\n";
21+
$counter ++;
22+
}
23+
}
24+
?>
25+
{name: 'Blue Bell', email: '[email protected]'}
26+
]
27+
}

mail/demo.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<div id="preLoader"><p></p></div>
1515
<div dojoType="dojo.data.ItemFileWriteStore" jsId="mailStore"
1616
url="mail.json"></div>
17+
<div dojoType="dojo.data.ItemFileWriteStore" jsId="contactStore"
18+
url="contacts.php"></div>
1719

1820
<!-- Inline declaration for programmatically created "New Message" tabs -->
1921
<div dojoType="dijit.Declaration"
@@ -24,21 +26,14 @@
2426
<tr style="padding-top:5px;">
2527
<td style="padding-left:20px; padding-right: 8px; text-align:right;"><label for="${id}_to">To:</label></td>
2628
<td width=100%>
27-
<select dojoType="dijit.form.ComboBox" id="${id}_to" hasDownArrow="false">
28-
<option></option>
29-
<option>[email protected]</option>
30-
<option>[email protected]</option>
31-
<option>[email protected]</option>
32-
<option>[email protected]</option>
33-
<option>[email protected]</option>
34-
<option>[email protected]</option>
35-
</select>
29+
<input dojoType="dijit.form.ComboBox" id="${id}_to" hasDownArrow="false" store="contactStore" searchAttr="display"
30+
style="width: 40em;">
3631
</td>
3732
</tr>
3833
<tr>
3934
<td style="padding-left: 20px; padding-right:8px; text-align:right;"><label for="${id}_subject">Subject:</label></td>
4035
<td width=100%>
41-
<select dojoType="dijit.form.ComboBox" id="${id}_subject" hasDownArrow="false">
36+
<select dojoType="dijit.form.ComboBox" id="${id}_subject" hasDownArrow="false" style="width: 40em;">
4237
<option></option>
4338
<option>progress meeting</option>
4439
<option>reports</option>

0 commit comments

Comments
 (0)