Changeset 350 for Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js
- Timestamp:
- 07/03/12 16:57:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/ObjectBox.js
r349 r350 5 5 'dijit/_TemplatedMixin', 6 6 'dijit/_WidgetsInTemplateMixin', 7 'rft/ui/LineWithActionsWidget Thijs',7 'rft/ui/LineWithActionsWidget', 8 8 'dojo/text!./templates/ObjectBox.html', 9 ], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget Thijs, template){9 ], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){ 10 10 return declare('rft.ui.ObjectBox', [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], { 11 11 baseClass: "rftObjectBox", … … 21 21 }, 22 22 postCreate: function() { 23 this.line1 = new LineWithActionsWidget Thijs({23 this.line1 = new LineWithActionsWidget({ 24 24 title: this.title || "Untitled", 25 25 modifiers: 'green', … … 35 35 } 36 36 }).placeAt(this.line1Node); 37 this.line2 = new LineWithActionsWidget Thijs({37 this.line2 = new LineWithActionsWidget({ 38 38 title: this.subTitle || "", 39 39 modifiers: 'green', … … 41 41 }).placeAt(this.line1Node); 42 42 var line3Actions = this._createLine3Actions(); 43 this.line3 = new LineWithActionsWidget Thijs({43 this.line3 = new LineWithActionsWidget({ 44 44 title: this.lowerTitle || "", 45 45 modifiers: 'green', … … 101 101 }, 102 102 _editObject: function(customFunction) { 103 104 105 106 107 108 109 110 103 // TODO: Pass an edit call to the page script, along with reference to the object contained in this ObjectBox 104 alert("Default edit code"); 105 customFunction(); 106 }, 107 _deleteObject: function(customFunction) { 108 // TODO: Pass a delete call to the page script, along with reference to the object contained in this ObjectBox 109 customFunction(); 110 }, 111 111 112 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 113 _setTitleAttr: function(value) { 114 this.title = value; 115 if (this.line1 && this.line1.set) { 116 this.line1.set('title', this.title); 117 } 118 }, 119 _setSubTitleAttr: function(value) { 120 this.subTitle = value; 121 if (this.line2 && this.line2.set) { 122 this.line2.set('title', this.subTitle); 123 } 124 }, 125 _setLowerTitleAttr: function(value) { 126 this.lowerTitle = value; 127 if (this.line3 && this.line3.set) { 128 this.line3.set('title', this.lowerTitle); 129 } 130 }, 131 _setObjectTypeAttr: function(value) { 132 this.objectType = value; 133 this.iconNode.className = "rftIcon typeIcon rftIcon"+this.objectType; 134 }, 135 135 136 137 138 139 140 141 142 143 144 145 136 /* This is an experiment to embed the creation function in the ObjectBox class itself. This method cannot be static, but can be called externally as such: 137 * rft.ui.ObjectBox().CreateNew(args, ref, loc); 138 * TODO: Check with Hendrik if I should do this or not! 139 * */ 140 CreateNew: function(arguments, reference, location) { 141 var newBox = new rft.ui.ObjectBox(arguments); 142 newBox.startup(); 143 newBox.placeAt(reference, location); 144 } 145 }); 146 146 });
Note: See TracChangeset
for help on using the changeset viewer.