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

Last change on this file since 512 was 512, checked in by hendrikvanantwerpen, 11 years ago

Small fixes fir urls and validation.

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        startup: function() {
17            this.inherited(arguments);
18        },
19        _getValueAttr: function() {
20            var value = this.inherited(arguments);
21            value.respondentCanDeleteOwnResponse =
22                value.respondentCanDeleteOwnResponse.length > 0;
23            return value;
24        },
25        _setValueAttr: function(value) {
26            value.respondentCanDeleteOwnResponse =
27                value.respondentCanDeleteOwnResponse ? ["on"] : [];
28            this.inherited(arguments);
29        }
30    });
31});
Note: See TracBrowser for help on using the repository browser.