Last change
on this file since 443 was
443,
checked in by hendrikvanantwerpen, 12 years ago
|
Reorganized for Node --- the SVN gods hate us all!
Lost all historical info on moved files, because SVN is a f *.
Also we have Node now, serving both the static content and forwarding
database requests.
|
File size:
1.1 KB
|
Line | |
---|
1 | define([ |
---|
2 | "../../../widgets/_ComplexValueWidget", |
---|
3 | "dijit/form/CheckBox", |
---|
4 | "dijit/form/RadioButton", |
---|
5 | "dojo/_base/array", |
---|
6 | "dojo/_base/declare", |
---|
7 | "dojo/dom-construct", |
---|
8 | "dojo/text!./templates/MultipleChoiceInputWidget.html" |
---|
9 | ], function(_ComplexValueWidget, CheckBox, RadioButton, array, declare, domConstruct, template) { |
---|
10 | return declare([_ComplexValueWidget],{ |
---|
11 | templateString: template, |
---|
12 | startup: function() { |
---|
13 | if ( this._started ) { return; } |
---|
14 | this.inherited(arguments); |
---|
15 | |
---|
16 | domConstruct.empty(this.domNode); |
---|
17 | var Ctor = this.allowMultiple === true ? CheckBox : RadioButton; |
---|
18 | array.forEach(this.items, function(item, index){ |
---|
19 | var div = domConstruct.create("div", { |
---|
20 | }, this.domNode, "last"); |
---|
21 | var input = new Ctor({ |
---|
22 | name: index.toString() |
---|
23 | }).placeAt(div); |
---|
24 | var label = domConstruct.create("label",{ |
---|
25 | innerHTML: item.text |
---|
26 | }, div); |
---|
27 | }, this); |
---|
28 | } |
---|
29 | }); |
---|
30 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.