Line | |
---|
1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
---|
5 | <title>View generation -- Model-bound generation example</title> |
---|
6 | <script> |
---|
7 | require = { |
---|
8 | parseOnLoad: 0, |
---|
9 | isDebug: 1, |
---|
10 | async: 1, |
---|
11 | mvc: {debugBindings: 1} |
---|
12 | }; |
---|
13 | </script> |
---|
14 | <script src="../../../dojo/dojo.js" type="text/javascript"></script> |
---|
15 | <style type="text/css"> |
---|
16 | @import "css/app-format.css"; |
---|
17 | @import "../../../dijit/themes/claro/claro.css"; |
---|
18 | </style> |
---|
19 | <script type="text/javascript"> |
---|
20 | require([ |
---|
21 | "dojo/parser", |
---|
22 | "dojo/_base/json", |
---|
23 | "dijit/form/Textarea", |
---|
24 | "dojox/mvc/Generate" |
---|
25 | ], function(parser){ |
---|
26 | parser.parse(); |
---|
27 | }); |
---|
28 | </script> |
---|
29 | </head> |
---|
30 | <body class="claro"> |
---|
31 | <script type="dojo/require">at: "dojox/mvc/at"</script> |
---|
32 | <div id="wrapper"> |
---|
33 | <div id="header"> |
---|
34 | <div id="navigation"></div> |
---|
35 | <div id="headerInsert"> |
---|
36 | <h1>View generation example</h1> |
---|
37 | <h2>Data Binding - Generate Container.</h2> |
---|
38 | </div> |
---|
39 | </div> |
---|
40 | <div id="main"> |
---|
41 | <div id="leftNav"></div> |
---|
42 | <div id="mainContent"> |
---|
43 | <h3>Model</h3> |
---|
44 | <div class="row"> |
---|
45 | <textarea id="textarea" class="cell" data-dojo-type="dijit.form.Textarea"> |
---|
46 | { |
---|
47 | Serial: "360324", |
---|
48 | First: "John", |
---|
49 | Last: "Doe", |
---|
50 | Email: "jdoe@example.com", |
---|
51 | Address: { |
---|
52 | Street: "123 Valley Rd", |
---|
53 | City: "Katonah", |
---|
54 | State: "NY", |
---|
55 | Zip: "10536" |
---|
56 | }, |
---|
57 | Phones: [ |
---|
58 | { |
---|
59 | Areacode: "111", |
---|
60 | Local: "111-1111" |
---|
61 | },{ |
---|
62 | Areacode: "222", |
---|
63 | Local: "222-2222" |
---|
64 | } |
---|
65 | ], |
---|
66 | Member: { |
---|
67 | Since: "2010", |
---|
68 | Type: "Gold" |
---|
69 | } |
---|
70 | } |
---|
71 | </textarea> |
---|
72 | </div> |
---|
73 | <h3>Generated View</h3> |
---|
74 | <div data-dojo-type="dojox.mvc.Generate" |
---|
75 | data-dojo-props="children: at('widget:textarea', 'value').direction(at.from).transform({format: dojo.fromJson}), idNameMapping: {String: 'view_t'}"></div> |
---|
76 | </div> |
---|
77 | </div> |
---|
78 | </div> |
---|
79 | </body> |
---|
80 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.