Debian Codegraph @

dojox/mvc/tests/test_templatedWidgetList/myMvcTemplated3.js

raw symbols SCIP
1 define([
2 "dojo/_base/declare",
3 "dojox/mvc/Templated",
4 "dijit/registry",
5 "dojo/text!./test_mvc_widget_template3.html",
6 "dojox/mvc/at",
7 "dijit/form/TextBox",
8 "dijit/form/Button",
9 "dojox/mvc/Group",
10 "dojox/mvc/Output",
11 "dojox/mvc/Repeat"
12 ], function(declare, Templated, registry, template, at){
13 return dojo.declare("dojox.mvc.tests.test_templatedWidgetList.myMvcTemplated", [Templated], {
14 // summary:
15 // A sample templated widget for dojox.mvc
16 // description:
17 // This template is used to show how to use exprchar to avoid instance of _TemplatedMixin error in dojo.mvc data binding.
18 // If the templateString contains ${xxx}, it will throw an template error, use #{xxx} with exprchar :"#" instead.
19 // See how it works in test_mvc_widget.html and test_mvc_widget_template.html
20
21 // ctrl: dojox.mvc.ModelRefController
22 // The controller that the form widgets in the template refer to.
23 ctrl: null,
24
25 templateString: template,
26
27 startup: function(){
28 console.log("startup called in myMvcTemplated3!!! ");
29 this.labelNode.set("value", at("rel:", "Serial"));
30 this.inputNode.set("value", at("rel:", "First"));
31 // this.nameInputNode.set("value", at("rel:", "First"));
32 this.inherited("startup", arguments);
33 },
34
35 buildRendering: function(){
36 console.log("call myMvcTemplated3 buildRendering");
37 window.at = at;
38 this.inherited(arguments);
39 },
40
41 showDetails: function(){
42 // this works, but we can use this.indexAtStartup since it will be set.
43 //var index = this.parent.children.indexOf(this.target);
44 var index = this.indexAtStartup;
45 console.log("Called myMvcTemplated3 showDetails selected index="+index);
46 this.ctrl.set("cursorIndex", index);
47 },
48
49 getParent: function(){
50 console.log("Call myMvcTemplated3 getParent");
51 return null;
52 }
53 });
54 });