Changeset 1804
- Timestamp:
- 2011-01-03 13:12:12 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/kauri-forms/kauri-forms-extra/src/main/kauri/static/dblselect/js/dblselect.js
r1633 r1804 201 201 this.refreshButtonsState(); 202 202 this.refreshAddOtherButtonState(); 203 } 203 } 204 205 DoubleSelectControl.prototype.normaliseValue = function (value) { 206 var options = this.options.getValues(); 207 var optionValues = {}; 208 for (var i = 0; i < options.length; i++) { 209 optionValues[options[i]] = 1; 210 } 211 212 if (value) { 213 var newValue = []; 214 for (var i = 0; i < value.length; i++) { 215 var val = value[i]; 216 217 if (optionValues[val]) { 218 newValue.push(val); 219 } 220 } 221 return newValue; 222 } 223 } 204 224 205 225 DoubleSelectControl.prototype.readUserValue = function() { … … 221 241 222 242 this.userValueLabelMap = {}; 243 var optionValues = {}; 223 244 for (var i = 0; i < userValues.length; i++) { 224 245 this.userValueLabelMap[userValues[i]] = labels[i]; 246 optionValues[userValues[i]] = 1; 225 247 } 226 248 227 249 var $available = this.getElement("available"); 228 250 if ($available) { 251 this.setValue(this.getValue()); 229 252 this.refreshAvailableSelect(); 230 253 this.refreshSelectedSelect();
Note: See TracChangeset
for help on using the changeset viewer.