Ignore:
Timestamp:
09/03/12 18:14:37 (13 years ago)
Author:
hendrikvanantwerpen
Message:

Lots of small fixes.

Make it possible to read survey answers (when a question code is
provided), it is now displayed in place of the survey. More to come.

Some whitespace fixes.

File:
1 edited

Legend:

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

    r399 r406  
    2323                        store.query(null,{keys:this.survey.questions,include_docs:true})
    2424                        .forEach(function(question){
    25                             array.forEach(question.content,function(item){
    26                                 var w = f.createViewWidget(item);
     25                            array.forEach(question.content || [],function(item){
     26                                var w = f.createViewWidget(item,{
     27                                    name: question.code+'.'+item.code
     28                                });
    2729                                if ( w !== null ) {
    28                                     w.placeAt(this.questionsPane.containerNode,'last');
    29                                     w.startup();
     30                                    w.placeAt(this.questionsAnchor,'before');
    3031                                }
    3132                            },this);
     
    3738            },
    3839            _onSubmit: function(evt) {
     40                var value = this.questionsForm.get('value');
     41                this.questionsPane.set('content','<pre>'+JSON.stringify(value)+'</pre>');
    3942                event.stop(evt);
    4043                return false;
Note: See TracChangeset for help on using the changeset viewer.