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

Last change on this file since 513 was 513, checked in by hendrikvanantwerpen, 11 years ago
  • Another shot at getting change events right for _ComplexValueMixin. Our previous approach made it impossible to detect if a change was cause during startup. Now we work purely with widget 'change' events. Children are connected during postCreate, addChild. If you add children otherwise you need to call connectChildsChanges yourself. Also to make sure events are generated, use _setValueInternal if you really need to set the value attribute yourself.
  • Removed unused widget.
File size: 1008 bytes
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        }
27    });
28});
Note: See TracBrowser for help on using the repository browser.