| 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 with a store, commit and reset</title> |
| 6 | <script> |
| 7 | require = { |
| 8 | isDebug: 1, |
| 9 | parseOnLoad: 0, |
| 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/store/JsonRest", |
| 23 | "dojox/mvc/EditStoreRefController", |
| 24 | "dijit/form/Button", |
| 25 | "dijit/form/TextArea", |
| 26 | "dojox/mvc/Generate" |
| 27 | ], function(parser, JsonRest, EditStoreRefController){ |
| 28 | ctrl = new EditStoreRefController({store: new JsonRest({target: require.toUrl("dojox/mvc/tests/_data/mvcGenerateData.json")})}); |
| 29 | parser.parse(); |
| 30 | ctrl.queryStore({}); |
| 31 | console.log("test",ctrl); |
| 32 | }); |
| 33 | </script> |
| 34 | </head> |
| 35 | <body class="claro"> |
| 36 | <script type="dojo/require">at: "dojox/mvc/at"</script> |
| 37 | <div id="wrapper"> |
| 38 | <div id="header"> |
| 39 | <div id="navigation"></div> |
| 40 | <div id="headerInsert"> |
| 41 | <h1>View generation example</h1> |
| 42 | <h2>Data Binding - Generate Container, with a store, commit and reset.</h2> |
| 43 | </div> |
| 44 | </div> |
| 45 | <div id="main"> |
| 46 | <div id="leftNav"></div> |
| 47 | <div id="mainContent"> |
| 48 | <h3>Generated View</h3> |
| 49 | <div data-dojo-type="dojox.mvc.Generate" data-dojo-props="children: at(ctrl, 'items')"></div> |
| 50 | <div class="row"> |
| 51 | <div class="spacer"></div> |
| 52 | <button type="button" data-dojo-type="dijit.form.Button" data-dojo-props="onClick: function(){ ctrl.commit(); }">Commit</button> |
| 53 | <button type="button" data-dojo-type="dijit.form.Button" data-dojo-props="onClick: function(){ ctrl.reset(); }">Reset</button> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | </body> |
| 58 | </html> |