Changeset 374 for Dev/branches/rest-dojo-ui/client/rft/pages/question.js
- Timestamp:
- 07/24/12 16:39:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/question.js
r372 r374 1 1 define(['dojo/_base/declare', 2 2 'dojo/_base/lang', 3 'dojo/_base/event', 3 4 'dojo/_base/Deferred', 4 5 'rft/ui/LineWithActionsWidget', … … 14 15 'rft/ui/QuestionEditorToolkit', 15 16 'dijit/form/FilteringSelect'], 16 function(declare, lang, Deferred, LineWithActionsWidget, store, _Page, api, content, registry, on, behavior, query){17 function(declare, lang, event, Deferred, LineWithActionsWidget, store, _Page, api, content, registry, on, behavior, query){ 17 18 return declare('rft.pages.question', [_Page], { 18 19 question: null, … … 37 38 }, 38 39 _refresh: function () { 39 this._toolkit.propertiesForm.set('value', this.question); 40 this._toolkit.loadQuestion(this.question); 41 }, 42 _onSave: function() { 43 lang.mixin(this.question, this._toolkit.propertiesForm.get('value')); 44 this.question.categories = this._toolkit._categories; 45 store.put(this.question) 46 .then(function() { 47 content.goTo('questions'); 48 }); 49 return false; 50 }, 51 _onDiscard: function() { 52 this._toolkit.propertiesForm.reset(); 53 content.goTo('questions'); 54 return false; 40 55 }, 41 56 _setupButtons: function() { … … 43 58 "#btnSave": { 44 59 onclick: lang.hitch(this, function(){ 45 this._ saveSurvey();60 this._onSave(); 46 61 }) 47 62 }, 48 63 "#btnDiscard": { 49 64 onclick: lang.hitch(this, function(){ 50 this._ restartEditor();65 this._onDiscard(); 51 66 }) 52 67 }
Note: See TracChangeset
for help on using the changeset viewer.