Changeset 343 for Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
- Timestamp:
- 06/18/12 12:51:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/survey.js
r316 r343 5 5 return declare('rft.pages.survey',[_Page],{ 6 6 object: null, 7 postCreate: function() {8 this.inherited(arguments);9 this._surveyStore = store.getStore('Survey');10 this._questionStore = store.getStore('Question');11 },12 7 onVisit: function() { 13 8 if ( this.pageArgs.uid ) { 14 Deferred.when( this._surveyStore.get(this.pageArgs.uid))9 Deferred.when(store.get(this.pageArgs.uid)) 15 10 .then(lang.hitch(this,function(obj){ 16 11 this.object = obj; … … 21 16 this.creator.innerHTML = (obj && obj.email) || 'unknown'; 22 17 })); 23 Deferred.when( this._questionStore.query())18 Deferred.when(store.query('_design/default/_view/by_type',{key:'Question'})) 24 19 .then(lang.hitch(this,function(items){ 25 20 this._questionList = new AccordionList({ 26 store: this._surveyStore,27 21 actions: { 28 22 'Add': lang.hitch(this,'_addQuestion') 29 23 }, 30 idProperty: this._questionStore.idProperty,31 24 categoryProperty: 'category', 32 25 titleProperty: 'title' … … 44 37 onSave: function(evt) { 45 38 lang.mixin(this.object,this.form.get('value')); 46 Deferred.when( this._store.put(this.object) )39 Deferred.when( store.put(this.object) ) 47 40 .then(lang.hitch(this,function(obj){ 48 41 this.object = obj; … … 53 46 })); 54 47 event.stop(evt); 48 evt.stopPropagation(); 55 49 return false; 56 50 },
Note: See TracChangeset
for help on using the changeset viewer.