Ignore:
Timestamp:
07/24/12 16:39:41 (13 years ago)
Author:
jkraaijeveld
Message:

Can now edit basic question properties and store them.

Location:
Dev/branches/rest-dojo-ui/client/rft/pages
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/pages/question.js

    r372 r374  
    11define(['dojo/_base/declare',
    22    'dojo/_base/lang',
     3    'dojo/_base/event',
    34    'dojo/_base/Deferred',
    45    'rft/ui/LineWithActionsWidget',
     
    1415    'rft/ui/QuestionEditorToolkit',
    1516    '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){
    1718        return declare('rft.pages.question', [_Page], {
    1819            question: null,
     
    3738            },
    3839            _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;
    4055            },
    4156            _setupButtons: function() {
     
    4358                    "#btnSave": {
    4459                        onclick: lang.hitch(this, function(){
    45                             this._saveSurvey();
     60                            this._onSave();
    4661                        })
    4762                    },
    4863                    "#btnDiscard": {
    4964                        onclick: lang.hitch(this, function(){
    50                             this._restartEditor();
     65                            this._onDiscard();
    5166                        })
    5267                    }
  • Dev/branches/rest-dojo-ui/client/rft/pages/session.html

    r369 r374  
    3131                            <br/><br/>
    3232                           
    33                             <div data-rft-attach-point="listViewNode" class="rftLineListView">
     33                            <div data-rft-attach-point="listViewNode" class="rftAccountListView">
    3434                            </div>
    3535                        </fieldset>
  • Dev/branches/rest-dojo-ui/client/rft/pages/session.js

    r371 r374  
    5555            },
    5656            _addAccount: function(item) {
     57                if (!this.session.accounts)
     58                    this.session.accounts = [];
    5759                this.session.accounts.push(item);
    5860                this._listView.insertItem(item);
Note: See TracChangeset for help on using the changeset viewer.