Changeset 461 for Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputWidget.js
- Timestamp:
- 06/10/13 01:07:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputWidget.js
r443 r461 10 10 return declare([_ComplexValueWidget],{ 11 11 templateString: template, 12 allowMultiple: false, 12 13 startup: function() { 13 14 if ( this._started ) { return; } … … 20 21 }, this.domNode, "last"); 21 22 var input = new Ctor({ 22 name: index.toString() 23 name: this.allowMultiple === true ? index.toString() : 'choice', 24 value: item.text 23 25 }).placeAt(div); 24 26 var label = domConstruct.create("label",{ 27 for: input.id, 25 28 innerHTML: item.text 26 29 }, div); 27 30 }, this); 31 }, 32 _getValueAttr: function() { 33 var value = this.inherited(arguments); 34 if ( this.allowMultiple === true ) { 35 return value; 36 } else { 37 return value.choice; 38 } 39 }, 40 _setValueAttr: function(value) { 41 var inherited = this.getInherited(arguments); 42 if ( this.allowMultiple === true ) { 43 inherited.call(this,value); 44 } else { 45 inherited.call(this,{choice:value}); 46 } 28 47 } 29 48 });
Note: See TracChangeset
for help on using the changeset viewer.