Changeset 275 for Dev/branches/rest-dojo-ui/client/rft/ui
- Timestamp:
- 02/21/12 13:03:21 (13 years ago)
- Location:
- Dev/branches/rest-dojo-ui/client/rft/ui
- Files:
-
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.html
r274 r275 1 1 <div> 2 <h2>Question</h2> 3 <table> 4 <tr><td>Code</td><td data-dojo-attach-point="codeField"></td></tr> 5 <tr><td>Title</td><td data-dojo-attach-point="titleField"></td></tr> 6 <tr><td>Description</td><td data-dojo-attach-point="descriptionField"></td></tr> 7 </table> 2 <span data-dojo-attach-point="actionBar"></span> 3 <span data-dojo-attach-point="titleNode"></span> 8 4 </div> -
Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js
r274 r275 1 define(['dojo/_base/declare','d ijit/_WidgetBase','dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dojo/text!rft/ui/QuestionWidget.html'],2 function(declare, _WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){3 return declare('rft.ui. QuestionWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{1 define(['dojo/_base/declare','dojo/_base/lang','dijit/form/Button','dijit/_WidgetBase','dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin','dojo/text!rft/ui/LineWithActionsWidget.html'], 2 function(declare,lang,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){ 3 return declare('rft.ui.LineWithActionsWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{ 4 4 templateString: templateString, 5 question: null, 5 title: '', 6 userObject: null, 7 actions: {}, 6 8 startup: function() { 7 if ( this.question ) { 8 this.codeField.innerHTML = this.question.code; 9 this.titleField.innerHTML = this.question.title; 10 this.descriptionField.innerHTML = this.question.description; 9 this.inherited(arguments); 10 this._setupActions(); 11 this.refresh(); 12 }, 13 _setupActions: function() { 14 for (var action in this.actions) { 15 new Button({ 16 label: action, 17 onClick: lang.hitch(this,function(){ 18 this.actions[action](this.userObject); 19 }) 20 }).placeAt(this.actionBar); 11 21 } 22 }, 23 refresh: function() { 24 this.titleNode.innerHTML = this.title; 12 25 } 13 26 });
Note: See TracChangeset
for help on using the changeset viewer.