Changeset 417 for Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js
- Timestamp:
- 12/09/12 16:49:22 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js
r416 r417 4 4 'dojo/_base/lang', 5 5 'dojo/when', 6 'rx/rx.dojo', 6 7 '../store', 7 8 '../app/Content', 8 9 '../app/Page', 9 10 '../app/Router', 10 '../ ui/LineWithActionsWidget',11 'dojo/text!./ surveys.html'12 ],function(array,declare,lang,when, store,Content,Page,Router,LineWithActionsWidget,template){11 '../widgets/LineWithActionsWidget', 12 'dojo/text!./templates/surveys.html' 13 ],function(array,declare,lang,when,Rx,store,Content,Page,Router,LineWithActionsWidget,template){ 13 14 return declare([Page],{ 14 15 templateString: template, … … 47 48 }, 48 49 _onRunSurvey:function(survey){ 50 this.surveyRun = { 51 type: 'SurveyRun', 52 surveyId: store.getIdentity(survey), 53 publicationDate: store.timestamp() 54 }; 55 this.surveyRunDialog.set('value',this.surveyRun); 49 56 this.surveyRunDialog.show(); 57 }, 58 _onSurveyRunOk: function() { 59 var surveyRun = lang.mixin(lang.clone(this.surveyRun),this.surveyRunDialog.get('value')); 60 store.put(surveyRun) 61 .then(lang.hitch(this,function(){ 62 this.surveyRunDialog.hide(); 63 this.refreshRuns(); 64 }),function(err){ 65 Content.notify(err); 66 }); 67 }, 68 _onSurveyRunCancel: function() { 69 this.surveyRunDialog.hide(); 50 70 }, 51 71 refresh: function() { … … 131 151 array.forEach(surveyRuns,function(surveyRun){ 132 152 var w = new LineWithActionsWidget({ 133 title: survey .title,153 title: surveyRun.title+" (from "+surveyRun.startDate+" to "+surveyRun.endDate+")", 134 154 actions:[{ 135 155 callback: lang.hitch(this,'_onCloseRun',surveyRun),
Note: See TracChangeset
for help on using the changeset viewer.