Debian Codegraph @

dojox/app/tests/domOrderByConstraint/main/main2.js

raw symbols SCIP
1 define(["dojo/dom", "dojo/_base/connect", "dijit/registry"],
2 function(dom, connect, registry){
3
4 var _connectResults = []; // events connect results
5 var currentModel = null;
6
7 var setFromModel = function (){
8 // registry.byId("firstInput1").set('value', currentModel[0].First);
9 // registry.byId("lastInput1").set('value', currentModel[0].Last);
10 // registry.byId("emailInput1").set('value', currentModel[0].Email);
11 // registry.byId("shiptostreetInput1").set('value', currentModel[0].ShipTo.Street);
12 // registry.byId("shiptocityInput1").set('value', currentModel[0].ShipTo.City);
13 // registry.byId("shiptostateInput1").set('value', currentModel[0].ShipTo.State);
14 // registry.byId("shiptozipInput1").set('value', currentModel[0].ShipTo.Zip);
15 // registry.byId("billtostreetInput1").set('value', currentModel[0].BillTo.Street);
16 // registry.byId("billtocityInput1").set('value', currentModel[0].BillTo.City);
17 // registry.byId("billtostateInput1").set('value', currentModel[0].BillTo.State);
18 // registry.byId("billtozipInput1").set('value', currentModel[0].BillTo.Zip);
19 };
20
21 return {
22 // simple view init
23 init: function(){
24 currentModel = this.loadedModels.names;
25 var connectResult;
26
27 var self = this;
28 connectResult = connect.connect(dom.byId('2testRTL'), "click", function(e){
29 console.log("testRTL called. ");
30 //first set the dir="rtl" on the app root
31 self.app.domNode.parentNode.dir = "rtl";
32 //next unload all chldren
33 var params = {};
34 var footer = self.app.children.domOrderByConstraint_footer;
35 var header = footer.children.domOrderByConstraint_footer_header;
36 var right = header.children.domOrderByConstraint_footer_header_right;
37 var left = right.children.domOrderByConstraint_footer_header_right_left;
38 var center = left.children.domOrderByConstraint_footer_header_right_left_center;
39 params.view = header;
40 params.parent = footer;
41 //params.viewId = view.id;
42 self.app.emit("unload-view", params);
43 });
44 _connectResults.push(connectResult);
45
46 connectResult = connect.connect(dom.byId('2testRTL2'), "click", function(e){
47 console.log("testRTL called. ");
48 var params = {};
49 var footer = self.app.children.domOrderByConstraint_footer;
50 //first set the dir="rtl" on the footer
51 footer.domNode.parentNode.dir = "rtl";
52
53 //next unload all chldren
54 var header = footer.children.domOrderByConstraint_footer_header;
55 var right = header.children.domOrderByConstraint_footer_header_right;
56 var left = right.children.domOrderByConstraint_footer_header_right_left;
57 var center = left.children.domOrderByConstraint_footer_header_right_left_center;
58 params.view = header;
59 params.parent = footer;
60 //params.viewId = view.id;
61 self.app.emit("unload-view", params);
62 });
63 _connectResults.push(connectResult);
64
65 connectResult = connect.connect(dom.byId('2testLTR'), "click", function(e){
66 console.log("testLTR called. ");
67 //first set the dir="rtl" on the app root
68 self.app.domNode.parentNode.dir = "ltr";
69 //next unload all chldren
70 var params = {};
71 var footer = self.app.children.domOrderByConstraint_footer;
72 var header = footer.children.domOrderByConstraint_footer_header;
73 var right = header.children.domOrderByConstraint_footer_header_right;
74 var left = right.children.domOrderByConstraint_footer_header_right_left;
75 var center = left.children.domOrderByConstraint_footer_header_right_left_center;
76 params.view = header;
77 params.parent = footer;
78 //params.viewId = view.id;
79 self.app.emit("unload-view", params);
80 });
81 _connectResults.push(connectResult);
82
83 connectResult = connect.connect(dom.byId('2testLTR2'), "click", function(e){
84 console.log("testLTR called. ");
85 var params = {};
86 var footer = self.app.children.domOrderByConstraint_footer;
87 //first set the dir="ltr" on the footer
88 footer.domNode.parentNode.dir = "ltr";
89
90 //next unload all chldren
91 var header = footer.children.domOrderByConstraint_footer_header;
92 var right = header.children.domOrderByConstraint_footer_header_right;
93 var left = right.children.domOrderByConstraint_footer_header_right_left;
94 var center = left.children.domOrderByConstraint_footer_header_right_left_center;
95 params.view = header;
96 params.parent = footer;
97 //params.viewId = view.id;
98 self.app.emit("unload-view", params);
99 });
100 _connectResults.push(connectResult);
101
102 },
103
104 // simple view destroy
105 destroy: function(){
106 var connectResult = _connectResults.pop();
107 while(connectResult){
108 connect.disconnect(connectResult);
109 connectResult = _connectResults.pop();
110 }
111 }
112 };
113 });