Ignore:
Timestamp:
04/29/13 19:35:10 (12 years ago)
Author:
hendrikvanantwerpen
Message:

Big cleanup of the question content.

  • Replaced old list implementations with a new one that behaves like a form widget.
  • All question content is now in separate widgets, not in the factory itself.
  • Added form and widget validation for question editing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/client/qed/pages/survey.js

    r426 r441  
    5555        _setupListView: function() {
    5656            this.questionList = new QuestionListView({
    57                 region: 'center'
     57                region: 'center',
     58                name: 'questions'
    5859            },this.surveyListViewNode);
    5960            this.questionList.startup();
     
    6768                .then(lang.hitch(this,function(survey){
    6869                    this.survey = survey;
    69                     array.forEach(Survey.Questions.get(this.survey),
    70                         lang.hitch(this.questionList,'appendItem'));
     70                    this.questionList.set('value',
     71                                          Survey.Questions.get(this.survey));
    7172                    this.refresh();
    7273                }));
     
    7475        },
    7576        _includeQuestion: function(question) {
    76             this.questionList.insertItem(question);
     77            this.questionList.appendItem(question);
    7778        },
    7879        refresh: function() {
     
    9798        },
    9899        _onSave: function(evt) {
    99             this.survey.questions = this.questionList.getItems();
     100            this.survey.questions = this.questionList.get('value');
    100101            store.put(this.survey)
    101102            .then(function() {
Note: See TracChangeset for help on using the changeset viewer.