source: Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js

Last change on this file was 531, checked in by hendrikvanantwerpen, 11 years ago
  • Return to using truly ISO formatted dates, including milliseconds.
  • Also set constraint on surveyrun dates when value is initially set.
  • Separate runs & results from surveys and questions.
  • Moved date & email format to schema itself.
File size: 1.1 KB
Line 
1define([
2    "../../widgets/_ComplexValueWidget",
3    "dojo/_base/declare",
4    "dojo/date",
5    "dojo/text!./templates/SurveyRunWidget.html"
6], function(_ComplexValueWidget, declare, date, template) {
7    return declare([_ComplexValueWidget],{
8        templateString: template,
9        postCreate: function() {
10            this.inherited(arguments);
11            var endDateBox = this.endDateBox;
12            this.own(this.startDateBox.on('change', function(value){
13                endDateBox.constraints.min = value;
14            }));
15        },
16        _getValueAttr: function() {
17            var value = this.inherited(arguments);
18            value.respondentCanDeleteOwnResponse =
19                value.respondentCanDeleteOwnResponse.length > 0;
20            return value;
21        },
22        _setValueAttr: function(value) {
23            value.respondentCanDeleteOwnResponse =
24                value.respondentCanDeleteOwnResponse ? ["on"] : [];
25            this.inherited(arguments);
26            this.endDateBox.constraints.min =
27                this.startDateBox.get('value');
28        }
29    });
30});
Note: See TracBrowser for help on using the repository browser.