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

Last change on this file since 492 was 490, checked in by hendrikvanantwerpen, 11 years ago
  • Mark content as dirty to prevent moving away from unsaved data.
  • Better change propagation from lists and our own widgets.
  • Generate notifications for errors and show correct message.
  • Moved all path/url generation to the class stores, not everywhere we use it.
  • Give user always a choice between Save and Save & Close.
  • Better refresh behaviour on form changes and saves.
  • Don't generate duplicate code error when existing object is the one you're storing.
File size: 893 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.