source: Dev/trunk/src/client/qed-client/model/widgets/SurveySummary.js @ 495

Last change on this file since 495 was 493, checked in by hendrikvanantwerpen, 11 years ago
  • _ComplexValueMixin propagates priorityChange to children.
  • Deserialize updated docs after save too.
  • Validate to false if definitions are missing.
File size: 899 bytes
Line 
1define([
2    "../classes/surveys",
3    "dijit/_TemplatedMixin",
4    "dijit/_WidgetBase",
5    "dojo/_base/declare",
6    "dojo/dom-attr",
7    "dojo/text!./templates/SurveySummary.html"
8], function(surveys, _TemplatedMixin, _WidgetBase, declare, domAttr, template) {
9    return declare([_WidgetBase,_TemplatedMixin],{
10        templateString: template,
11        survey: null,
12        startup: function() {
13            this.inherited(arguments);
14            if ( this.survey ) {
15                this._setValueAttr(this.survey);
16            }
17        },
18        _setValueAttr: function(survey) {
19            this.titleNode.innerHTML = survey.title || "";
20            domAttr.set(this.titleNode, "href", survey && surveys.getObjectPath(survey));
21            this.descriptionNode.innerHTML = survey.description || "";
22            this.questionsNode.innerHTML = survey.questions.length;
23        }
24    });
25});
Note: See TracBrowser for help on using the repository browser.