Changeset 383
- Timestamp:
- 07/27/12 16:26:11 (13 years ago)
- Location:
- Dev/branches/rest-dojo-ui/client/rft/ui
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/InnerWidgetFactory.js
r381 r383 1 define( ['dojo', 'dijit', 'dojo/_base/lang', 'dojox/layout/TableContainer', 2 'dijit/layout/StackContainer'], 3 function(dojo, dijit, lang, TableContainer, StackContainer) { 1 define( [ 2 'dojo', 3 'dojo/_base/lang', 4 'dijit', 5 'dijit/layout/StackContainer', 6 'dojox/form/CheckedMultiSelect', 7 'dojox/layout/TableContainer', 8 'rft/ui/MultipleChoiceListView'], 9 function(dojo, lang, dijit, StackContainer, CheckedMultiSelect, TableContainer, ListView) { 4 10 dojo.provide('rft.ui.InnerWidgetFactory'); 5 11 dojo.declare('rft.ui.InnerWidgetFactory', [],{ … … 29 35 integerWidget.setObject(options); 30 36 return integerWidget; 37 }, 38 createMultipleChoiceInputWidget: function(options) { 39 var mcWidget = new rft.ui.MultipleChoiceInput(); 40 mcWidget.setObject(options); 41 return mcWidget; 31 42 } 32 43 }); … … 72 83 }); 73 84 85 //Use CheckedMultiSelect 86 dojo.declare('rft.ui.MultipleChoiceInput', StackContainer, { 87 _multiSelect: null, 88 postCreate: function() { 89 this.inherited(arguments); 90 this._multiSelect = new CheckedMultiSelect(); 91 this._multiSelect.addOption({ label: "Hurr durr", value: 1 }); 92 this._multiSelect.addOption({ label: "This is a choice", value: 1 }); 93 this._multiSelect.addOption({ label: "This too", value: 1 }); 94 this._multiSelect.addOption({ label: "So because there are more", value: 1 }); 95 this._multiSelect.addOption({ label: "This must be multiple choice.", value: 1 }); 96 this.addChild(this._multiSelect); 97 }, 98 99 setObject: function() { 100 return; 101 }, 102 103 edit: function() { 104 return; 105 } 106 107 }); 108 74 109 dojo.declare('rft.ui.IntegerInput', StackContainer, { 75 110 _numberSpinner: null, … … 79 114 postCreate: function() { 80 115 this.inherited(arguments); 81 this._numberSpinner = new dijit.form.NumberSpinner( { title: "Answer", value: 0 }); 82 this._numberSpinner.startup(); 116 this._numberSpinner = new dijit.form.NumberSpinner( { title: "Answer", value: 0, constraints: { min: -100, max: 100 } }); 83 117 this._simpleTable = new TableContainer({ cols: 1, customClass: "labelsAndValues", labelWidth : 150} ); 84 118 this._simpleTable.addChild(this._numberSpinner); 85 86 119 this._editTable = new TableContainer({ cols: 1, customClass: "labelsAndValues"} ); 87 120 this._simpleTable.startup(); 88 121 this.addChild(this._simpleTable); 89 122 }, … … 136 169 }, 137 170 getObject: function() { 138 139 return { widgetType: 'IntegerInput', 140 contents: 141 { 142 value: this._numberSpinner.value, 143 smallDelta: this._numberSpinner.smallDelta, 144 constraints: this._numberSpinner.constraints, 145 invalidMessage: this._numberSpinner.invalidMessage, 146 title: this._numberSpinner.title 147 } 171 return { 172 widgetType: 'IntegerInput', 173 contents: { 174 value: this._numberSpinner.value, 175 smallDelta: this._numberSpinner.smallDelta, 176 constraints: this._numberSpinner.constraints, 177 invalidMessage: this._numberSpinner.invalidMessage, 178 title: this._numberSpinner.title 179 } 148 180 }; 149 181 } -
Dev/branches/rest-dojo-ui/client/rft/ui/OrderedList.js
r374 r383 96 96 this.source.insertNodes(false, [item]); 97 97 } 98 } 99 98 }, 99 getItems: function() { 100 return this.source.getAllNodes() 101 .map(function(node){ 102 return this.source.getItem(node.id).data; 103 },this); 104 }, 100 105 }); 101 106 });
Note: See TracChangeset
for help on using the changeset viewer.