Changeset 416 for Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
- Timestamp:
- 12/04/12 17:36:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
r410 r416 27 27 this._setupQuestionBrowser(); 28 28 this._setupListView(); 29 this._ setupSurvey();29 this._loadSurvey(); 30 30 } else { 31 31 throw "No valid uid or survey passed!"; … … 60 60 this.questionList.startup(); 61 61 }, 62 _setupSurvey: function() { 63 Deferred.when(store.get(this.surveyId)) 64 .then(lang.hitch(this,function(survey){ 65 this.survey = survey; 66 store.query(null,{keys:this.survey.questions || [], include_docs: true}) 67 .forEach(lang.hitch(this.questionList,'appendItem')); 62 _loadSurvey: function() { 63 if ( this.surveyId === "new" ) { 64 this.survey = { 65 type: 'Survey' 66 }; 68 67 this.refresh(); 69 })); 68 } else { 69 Deferred.when(store.get(this.surveyId)) 70 .then(lang.hitch(this,function(survey){ 71 this.survey = survey; 72 store.query(null,{keys:this.survey.questions || [], include_docs: true}) 73 .forEach(lang.hitch(this.questionList,'appendItem')); 74 this.refresh(); 75 })); 76 } 70 77 }, 71 78 _includeQuestion: function(question) {
Note: See TracChangeset
for help on using the changeset viewer.