Ignore:
Timestamp:
03/12/14 15:16:54 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Factored out general object mapping and iteration.
  • Split widgets for multiplechoice and singlechoice.
  • Restored readOnly/disabled setting for QuestionEditorPreviewItem? on innerWidget (since view innerWidget is not a form anymore, we cannot just set it on that, we iterate over all form children now).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputWidget.js

    r508 r510  
    55    "dijit/_WidgetsInTemplateMixin",
    66    "dijit/form/CheckBox",
    7     "dijit/form/RadioButton",
    87    "dojo/_base/array",
    98    "dojo/_base/declare",
    109    "dojo/dom-construct",
    1110    "dojo/text!./templates/MultipleChoiceInputWidget.html"
    12 ], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, CheckBox, RadioButton, array, declare, domConstruct, template) {
     11], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, CheckBox, array, declare, domConstruct, template) {
    1312    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
    1413        templateString: template,
     
    1817
    1918            domConstruct.empty(this.domNode);
    20             var Ctor = this.allowMultiple === true ? CheckBox : RadioButton;
    2119            array.forEach(this.items, function(item){
    2220                var div = domConstruct.create("div", {
    2321                }, this.domNode, "last");
    24                 var input = new Ctor({
    25                     name: this.code + (this.allowMultiple === true ? item.subcode : ''),
    26                     value: this.allowMultiple === true ? null : item.subcode
     22                var input = new CheckBox({
     23                    name: this.code + item.subcode,
     24                    value: 1
    2725                }).placeAt(div);
    2826                var label = domConstruct.create("label",{
Note: See TracChangeset for help on using the changeset viewer.