| 1 |
define([ |
| 2 |
"dojo/_base/array", |
| 3 |
"dojo/_base/Deferred", |
| 4 |
"dojo/aspect", |
| 5 |
"dojo/data/util/sorter", |
| 6 |
"dojo/_base/declare", |
| 7 |
"dojo/dom", |
| 8 |
"dojo/dom-class", |
| 9 |
"dojo/_base/kernel", |
| 10 |
"dojo/_base/lang", |
| 11 |
"dojo/query", |
| 12 |
"dojo/when", |
| 13 |
"dojo/store/util/QueryResults", |
| 14 |
"./_FormValueWidget" |
| 15 |
], function(array, Deferred, aspect, sorter, declare, dom, domClass, kernel, lang, query, when, |
| 16 |
QueryResults, _FormValueWidget){ |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
var _FormSelectWidget = declare("dijit.form._FormSelectWidget", _FormValueWidget, { |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
multiple: false, |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
options: null, |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
store: null, |
| 56 |
_setStoreAttr: function(val){ |
| 57 |
if(this._created){ |
| 58 |
this._deprecatedSetStore(val); |
| 59 |
} |
| 60 |
}, |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
query: null, |
| 65 |
_setQueryAttr: function(query){ |
| 66 |
if(this._created){ |
| 67 |
this._deprecatedSetStore(this.store, this.selectedValue, {query: query}); |
| 68 |
} |
| 69 |
}, |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
queryOptions: null, |
| 74 |
_setQueryOptionsAttr: function(queryOptions){ |
| 75 |
if(this._created){ |
| 76 |
this._deprecatedSetStore(this.store, this.selectedValue, {queryOptions: queryOptions}); |
| 77 |
} |
| 78 |
}, |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
labelAttr: "", |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
onFetch: null, |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
sortByLabel: true, |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
loadChildrenOnOpen: false, |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
onLoadDeferred: null, |
| 109 |
|
| 110 |
getOptions: function( valueOrIdx){ |
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
var opts = this.options || []; |
| 142 |
|
| 143 |
if(valueOrIdx == null){ |
| 144 |
return opts; |
| 145 |
} |
| 146 |
if(lang.isArrayLike(valueOrIdx)){ |
| 147 |
return array.map(valueOrIdx, function(item){ |
| 148 |
return this.getOptions(item); |
| 149 |
}, this); |
| 150 |
} |
| 151 |
if(lang.isString(valueOrIdx)){ |
| 152 |
valueOrIdx = { value: valueOrIdx }; |
| 153 |
} |
| 154 |
if(lang.isObject(valueOrIdx)){ |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
if(!array.some(opts, function(option, idx){ |
| 159 |
for(var a in valueOrIdx){ |
| 160 |
if(!(a in option) || option[a] != valueOrIdx[a]){ |
| 161 |
return false; |
| 162 |
} |
| 163 |
} |
| 164 |
valueOrIdx = idx; |
| 165 |
return true; |
| 166 |
})){ |
| 167 |
valueOrIdx = -1; |
| 168 |
} |
| 169 |
} |
| 170 |
if(valueOrIdx >= 0 && valueOrIdx < opts.length){ |
| 171 |
return opts[valueOrIdx]; |
| 172 |
} |
| 173 |
return null; |
| 174 |
}, |
| 175 |
|
| 176 |
addOption: function( option){ |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
array.forEach(lang.isArrayLike(option) ? option : [option], function(i){ |
| 183 |
if(i && lang.isObject(i)){ |
| 184 |
this.options.push(i); |
| 185 |
} |
| 186 |
}, this); |
| 187 |
this._loadChildren(); |
| 188 |
}, |
| 189 |
|
| 190 |
removeOption: function( valueOrIdx){ |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
var oldOpts = this.getOptions(lang.isArrayLike(valueOrIdx) ? valueOrIdx : [valueOrIdx]); |
| 200 |
array.forEach(oldOpts, function(option){ |
| 201 |
|
| 202 |
|
| 203 |
if(option){ |
| 204 |
this.options = array.filter(this.options, function(node){ |
| 205 |
return (node.value !== option.value || node.label !== option.label); |
| 206 |
}); |
| 207 |
this._removeOptionItem(option); |
| 208 |
} |
| 209 |
}, this); |
| 210 |
this._loadChildren(); |
| 211 |
}, |
| 212 |
|
| 213 |
updateOption: function( newOption){ |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
array.forEach(lang.isArrayLike(newOption) ? newOption : [newOption], function(i){ |
| 220 |
var oldOpt = this.getOptions({ value: i.value }), k; |
| 221 |
if(oldOpt){ |
| 222 |
for(k in i){ |
| 223 |
oldOpt[k] = i[k]; |
| 224 |
} |
| 225 |
} |
| 226 |
}, this); |
| 227 |
this._loadChildren(); |
| 228 |
}, |
| 229 |
|
| 230 |
setStore: function(store, selectedValue, fetchArgs){ |
| 231 |
kernel.deprecated(this.declaredClass+"::setStore(store, selectedValue, fetchArgs) is deprecated. Use set('query', fetchArgs.query), set('queryOptions', fetchArgs.queryOptions), set('store', store), or set('value', selectedValue) instead.", "", "2.0"); |
| 232 |
this._deprecatedSetStore(store, selectedValue, fetchArgs); |
| 233 |
}, |
| 234 |
|
| 235 |
_deprecatedSetStore: function(store, selectedValue, fetchArgs){ |
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
var oStore = this.store; |
| 257 |
fetchArgs = fetchArgs || {}; |
| 258 |
|
| 259 |
if(oStore !== store){ |
| 260 |
|
| 261 |
var h; |
| 262 |
while((h = this._notifyConnections.pop())){ |
| 263 |
h.remove(); |
| 264 |
} |
| 265 |
|
| 266 |
|
| 267 |
if(!store.get){ |
| 268 |
lang.mixin(store, { |
| 269 |
_oldAPI: true, |
| 270 |
get: function(id){ |
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
var deferred = new Deferred(); |
| 275 |
this.fetchItemByIdentity({ |
| 276 |
identity: id, |
| 277 |
onItem: function(object){ |
| 278 |
deferred.resolve(object); |
| 279 |
}, |
| 280 |
onError: function(error){ |
| 281 |
deferred.reject(error); |
| 282 |
} |
| 283 |
}); |
| 284 |
return deferred.promise; |
| 285 |
}, |
| 286 |
query: function(query, options){ |
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
var deferred = new Deferred(function(){ |
| 291 |
if(fetchHandle.abort){ |
| 292 |
fetchHandle.abort(); |
| 293 |
} |
| 294 |
}); |
| 295 |
deferred.total = new Deferred(); |
| 296 |
var fetchHandle = this.fetch(lang.mixin({ |
| 297 |
query: query, |
| 298 |
onBegin: function(count){ |
| 299 |
deferred.total.resolve(count); |
| 300 |
}, |
| 301 |
onComplete: function(results){ |
| 302 |
deferred.resolve(results); |
| 303 |
}, |
| 304 |
onError: function(error){ |
| 305 |
deferred.reject(error); |
| 306 |
} |
| 307 |
}, options)); |
| 308 |
return new QueryResults(deferred); |
| 309 |
} |
| 310 |
}); |
| 311 |
|
| 312 |
if(store.getFeatures()["dojo.data.api.Notification"]){ |
| 313 |
this._notifyConnections = [ |
| 314 |
aspect.after(store, "onNew", lang.hitch(this, "_onNewItem"), true), |
| 315 |
aspect.after(store, "onDelete", lang.hitch(this, "_onDeleteItem"), true), |
| 316 |
aspect.after(store, "onSet", lang.hitch(this, "_onSetItem"), true) |
| 317 |
]; |
| 318 |
} |
| 319 |
} |
| 320 |
this._set("store", store); |
| 321 |
} |
| 322 |
|
| 323 |
|
| 324 |
if(this.options && this.options.length){ |
| 325 |
this.removeOption(this.options); |
| 326 |
} |
| 327 |
|
| 328 |
|
| 329 |
if(this._queryRes && this._queryRes.close){ |
| 330 |
this._queryRes.close(); |
| 331 |
} |
| 332 |
|
| 333 |
|
| 334 |
if(this._observeHandle && this._observeHandle.remove){ |
| 335 |
this._observeHandle.remove(); |
| 336 |
this._observeHandle = null; |
| 337 |
} |
| 338 |
|
| 339 |
|
| 340 |
if(fetchArgs.query){ |
| 341 |
this._set("query", fetchArgs.query); |
| 342 |
} |
| 343 |
if(fetchArgs.queryOptions){ |
| 344 |
this._set("queryOptions", fetchArgs.queryOptions); |
| 345 |
} |
| 346 |
|
| 347 |
|
| 348 |
if(store && store.query){ |
| 349 |
this._loadingStore = true; |
| 350 |
this.onLoadDeferred = new Deferred(); |
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
this._queryRes = store.query(this.query, this.queryOptions); |
| 355 |
when(this._queryRes, lang.hitch(this, function(items){ |
| 356 |
|
| 357 |
if(this.sortByLabel && !fetchArgs.sort && items.length){ |
| 358 |
if(store.getValue){ |
| 359 |
|
| 360 |
items.sort(sorter.createSortFunction([ |
| 361 |
{ |
| 362 |
attribute: store.getLabelAttributes(items[0])[0] |
| 363 |
} |
| 364 |
], store)); |
| 365 |
}else{ |
| 366 |
|
| 367 |
var labelAttr = this.labelAttr; |
| 368 |
items.sort(function(a, b){ |
| 369 |
return a[labelAttr] > b[labelAttr] ? 1 : b[labelAttr] > a[labelAttr] ? -1 : 0; |
| 370 |
}); |
| 371 |
} |
| 372 |
} |
| 373 |
|
| 374 |
if(fetchArgs.onFetch){ |
| 375 |
items = fetchArgs.onFetch.call(this, items, fetchArgs); |
| 376 |
} |
| 377 |
|
| 378 |
|
| 379 |
array.forEach(items, function(i){ |
| 380 |
this._addOptionForItem(i); |
| 381 |
}, this); |
| 382 |
|
| 383 |
|
| 384 |
if(this._queryRes.observe){ |
| 385 |
|
| 386 |
this._observeHandle = this._queryRes.observe(lang.hitch(this, function(object, deletedFrom, insertedInto){ |
| 387 |
if(deletedFrom == insertedInto){ |
| 388 |
this._onSetItem(object); |
| 389 |
}else{ |
| 390 |
if(deletedFrom != -1){ |
| 391 |
this._onDeleteItem(object); |
| 392 |
} |
| 393 |
if(insertedInto != -1){ |
| 394 |
this._onNewItem(object); |
| 395 |
} |
| 396 |
} |
| 397 |
}), true); |
| 398 |
} |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
this._loadingStore = false; |
| 403 |
this.set("value", "_pendingValue" in this ? this._pendingValue : selectedValue); |
| 404 |
delete this._pendingValue; |
| 405 |
|
| 406 |
if(!this.loadChildrenOnOpen){ |
| 407 |
this._loadChildren(); |
| 408 |
}else{ |
| 409 |
this._pseudoLoadChildren(items); |
| 410 |
} |
| 411 |
this.onLoadDeferred.resolve(true); |
| 412 |
this.onSetStore(); |
| 413 |
}), lang.hitch(this, function(err){ |
| 414 |
console.error('dijit.form.Select: ' + err.toString()); |
| 415 |
this.onLoadDeferred.reject(err); |
| 416 |
})); |
| 417 |
} |
| 418 |
return oStore; |
| 419 |
}, |
| 420 |
|
| 421 |
_setValueAttr: function( newValue, priorityChange){ |
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
if(!this._onChangeActive){ |
| 426 |
priorityChange = null; |
| 427 |
} |
| 428 |
if(this._loadingStore){ |
| 429 |
|
| 430 |
|
| 431 |
this._pendingValue = newValue; |
| 432 |
return; |
| 433 |
} |
| 434 |
if(newValue == null){ |
| 435 |
return; |
| 436 |
} |
| 437 |
if(lang.isArrayLike(newValue)){ |
| 438 |
newValue = array.map(newValue, function(value){ |
| 439 |
return lang.isObject(value) ? value : { value: value }; |
| 440 |
}); |
| 441 |
}else if(lang.isObject(newValue)){ |
| 442 |
newValue = [newValue]; |
| 443 |
}else{ |
| 444 |
newValue = [ |
| 445 |
{ value: newValue } |
| 446 |
]; |
| 447 |
} |
| 448 |
newValue = array.filter(this.getOptions(newValue), function(i){ |
| 449 |
return i && i.value; |
| 450 |
}); |
| 451 |
var opts = this.getOptions() || []; |
| 452 |
if(!this.multiple && (!newValue[0] || !newValue[0].value) && !!opts.length){ |
| 453 |
newValue[0] = opts[0]; |
| 454 |
} |
| 455 |
array.forEach(opts, function(opt){ |
| 456 |
opt.selected = array.some(newValue, function(v){ |
| 457 |
return v.value === opt.value; |
| 458 |
}); |
| 459 |
}); |
| 460 |
var val = array.map(newValue, function(opt){ |
| 461 |
return opt.value; |
| 462 |
}); |
| 463 |
|
| 464 |
if(typeof val == "undefined" || typeof val[0] == "undefined"){ |
| 465 |
return; |
| 466 |
} |
| 467 |
var disp = array.map(newValue, function(opt){ |
| 468 |
return opt.label; |
| 469 |
}); |
| 470 |
this._setDisplay(this.multiple ? disp : disp[0]); |
| 471 |
this.inherited(arguments, [ this.multiple ? val : val[0], priorityChange ]); |
| 472 |
this._updateSelection(); |
| 473 |
}, |
| 474 |
|
| 475 |
_getDisplayedValueAttr: function(){ |
| 476 |
|
| 477 |
|
| 478 |
var ret = array.map([].concat(this.get('selectedOptions')), function(v){ |
| 479 |
if(v && "label" in v){ |
| 480 |
return v.label; |
| 481 |
}else if(v){ |
| 482 |
return v.value; |
| 483 |
} |
| 484 |
return null; |
| 485 |
}, this); |
| 486 |
return this.multiple ? ret : ret[0]; |
| 487 |
}, |
| 488 |
|
| 489 |
_setDisplayedValueAttr: function(label){ |
| 490 |
|
| 491 |
|
| 492 |
this.set('value', this.getOptions(typeof label == "string" ? { label: label } : label)); |
| 493 |
}, |
| 494 |
|
| 495 |
_loadChildren: function(){ |
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
if(this._loadingStore){ |
| 500 |
return; |
| 501 |
} |
| 502 |
array.forEach(this._getChildren(), function(child){ |
| 503 |
child.destroyRecursive(); |
| 504 |
}); |
| 505 |
|
| 506 |
array.forEach(this.options, this._addOptionItem, this); |
| 507 |
|
| 508 |
|
| 509 |
this._updateSelection(); |
| 510 |
}, |
| 511 |
|
| 512 |
_updateSelection: function(){ |
| 513 |
|
| 514 |
|
| 515 |
this.focusedChild = null; |
| 516 |
this._set("value", this._getValueFromOpts()); |
| 517 |
var val = [].concat(this.value); |
| 518 |
if(val && val[0]){ |
| 519 |
var self = this; |
| 520 |
array.forEach(this._getChildren(), function(child){ |
| 521 |
var isSelected = array.some(val, function(v){ |
| 522 |
return child.option && (v === child.option.value); |
| 523 |
}); |
| 524 |
if(isSelected && !self.multiple){ |
| 525 |
self.focusedChild = child; |
| 526 |
} |
| 527 |
domClass.toggle(child.domNode, this.baseClass.replace(/\s+|$/g, "SelectedOption "), isSelected); |
| 528 |
child.domNode.setAttribute("aria-selected", isSelected ? "true" : "false"); |
| 529 |
}, this); |
| 530 |
} |
| 531 |
}, |
| 532 |
|
| 533 |
_getValueFromOpts: function(){ |
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
var opts = this.getOptions() || []; |
| 538 |
if(!this.multiple && opts.length){ |
| 539 |
|
| 540 |
var opt = array.filter(opts, function(i){ |
| 541 |
return i.selected; |
| 542 |
})[0]; |
| 543 |
if(opt && opt.value){ |
| 544 |
return opt.value; |
| 545 |
}else{ |
| 546 |
opts[0].selected = true; |
| 547 |
return opts[0].value; |
| 548 |
} |
| 549 |
}else if(this.multiple){ |
| 550 |
|
| 551 |
return array.map(array.filter(opts, function(i){ |
| 552 |
return i.selected; |
| 553 |
}), function(i){ |
| 554 |
return i.value; |
| 555 |
}) || []; |
| 556 |
} |
| 557 |
return ""; |
| 558 |
}, |
| 559 |
|
| 560 |
|
| 561 |
_onNewItem: function( item, parentInfo){ |
| 562 |
if(!parentInfo || !parentInfo.parent){ |
| 563 |
|
| 564 |
this._addOptionForItem(item); |
| 565 |
} |
| 566 |
}, |
| 567 |
_onDeleteItem: function( item){ |
| 568 |
var store = this.store; |
| 569 |
this.removeOption({value: store.getIdentity(item) }); |
| 570 |
}, |
| 571 |
_onSetItem: function( item){ |
| 572 |
this.updateOption(this._getOptionObjForItem(item)); |
| 573 |
}, |
| 574 |
|
| 575 |
_getOptionObjForItem: function(item){ |
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
|
| 581 |
|
| 582 |
var store = this.store, |
| 583 |
label = (this.labelAttr && this.labelAttr in item) ? item[this.labelAttr] : store.getLabel(item), |
| 584 |
value = (label ? store.getIdentity(item) : null); |
| 585 |
return {value: value, label: label, item: item}; |
| 586 |
}, |
| 587 |
|
| 588 |
_addOptionForItem: function( item){ |
| 589 |
|
| 590 |
|
| 591 |
var store = this.store; |
| 592 |
if(store.isItemLoaded && !store.isItemLoaded(item)){ |
| 593 |
|
| 594 |
|
| 595 |
store.loadItem({item: item, onItem: function(i){ |
| 596 |
this._addOptionForItem(i); |
| 597 |
}, |
| 598 |
scope: this}); |
| 599 |
return; |
| 600 |
} |
| 601 |
var newOpt = this._getOptionObjForItem(item); |
| 602 |
this.addOption(newOpt); |
| 603 |
}, |
| 604 |
|
| 605 |
constructor: function(params ){ |
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
|
| 614 |
|
| 615 |
|
| 616 |
|
| 617 |
this._oValue = (params || {}).value || null; |
| 618 |
this._notifyConnections = []; |
| 619 |
}, |
| 620 |
|
| 621 |
buildRendering: function(){ |
| 622 |
this.inherited(arguments); |
| 623 |
dom.setSelectable(this.focusNode, false); |
| 624 |
}, |
| 625 |
|
| 626 |
_fillContent: function(){ |
| 627 |
|
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
if(!this.options){ |
| 632 |
this.options = |
| 633 |
this.srcNodeRef |
| 634 |
? query("> *", this.srcNodeRef).map( |
| 635 |
function(node){ |
| 636 |
if(node.getAttribute("type") === "separator"){ |
| 637 |
return { value: "", label: "", selected: false, disabled: false }; |
| 638 |
} |
| 639 |
return { |
| 640 |
value: (node.getAttribute("data-" + kernel._scopeName + "-value") || node.getAttribute("value")), |
| 641 |
label: String(node.innerHTML), |
| 642 |
|
| 643 |
|
| 644 |
|
| 645 |
selected: node.getAttribute("selected") || false, |
| 646 |
disabled: node.getAttribute("disabled") || false |
| 647 |
}; |
| 648 |
}, |
| 649 |
this) |
| 650 |
: []; |
| 651 |
} |
| 652 |
if(!this.value){ |
| 653 |
this._set("value", this._getValueFromOpts()); |
| 654 |
}else if(this.multiple && typeof this.value == "string"){ |
| 655 |
this._set("value", this.value.split(",")); |
| 656 |
} |
| 657 |
}, |
| 658 |
|
| 659 |
postCreate: function(){ |
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
this.inherited(arguments); |
| 664 |
|
| 665 |
|
| 666 |
aspect.after(this, "onChange", lang.hitch(this, "_updateSelection")); |
| 667 |
|
| 668 |
|
| 669 |
var store = this.store; |
| 670 |
if(store && (store.getIdentity || store.getFeatures()["dojo.data.api.Identity"])){ |
| 671 |
|
| 672 |
|
| 673 |
this.store = null; |
| 674 |
this._deprecatedSetStore(store, this._oValue, {query: this.query, queryOptions: this.queryOptions}); |
| 675 |
} |
| 676 |
|
| 677 |
this._storeInitialized = true; |
| 678 |
}, |
| 679 |
|
| 680 |
startup: function(){ |
| 681 |
|
| 682 |
this._loadChildren(); |
| 683 |
this.inherited(arguments); |
| 684 |
}, |
| 685 |
|
| 686 |
destroy: function(){ |
| 687 |
|
| 688 |
|
| 689 |
|
| 690 |
var h; |
| 691 |
while((h = this._notifyConnections.pop())){ |
| 692 |
h.remove(); |
| 693 |
} |
| 694 |
|
| 695 |
|
| 696 |
if(this._queryRes && this._queryRes.close){ |
| 697 |
this._queryRes.close(); |
| 698 |
} |
| 699 |
|
| 700 |
|
| 701 |
if(this._observeHandle && this._observeHandle.remove){ |
| 702 |
this._observeHandle.remove(); |
| 703 |
this._observeHandle = null; |
| 704 |
} |
| 705 |
|
| 706 |
this.inherited(arguments); |
| 707 |
}, |
| 708 |
|
| 709 |
_addOptionItem: function( ){ |
| 710 |
|
| 711 |
|
| 712 |
|
| 713 |
|
| 714 |
|
| 715 |
}, |
| 716 |
|
| 717 |
_removeOptionItem: function( ){ |
| 718 |
|
| 719 |
|
| 720 |
|
| 721 |
}, |
| 722 |
|
| 723 |
_setDisplay: function( ){ |
| 724 |
|
| 725 |
|
| 726 |
|
| 727 |
|
| 728 |
}, |
| 729 |
|
| 730 |
_getChildren: function(){ |
| 731 |
|
| 732 |
|
| 733 |
return []; |
| 734 |
}, |
| 735 |
|
| 736 |
_getSelectedOptionsAttr: function(){ |
| 737 |
|
| 738 |
|
| 739 |
|
| 740 |
return this.getOptions({ selected: true }); |
| 741 |
}, |
| 742 |
|
| 743 |
_pseudoLoadChildren: function( ){ |
| 744 |
|
| 745 |
|
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
}, |
| 750 |
|
| 751 |
onSetStore: function(){ |
| 752 |
|
| 753 |
|
| 754 |
|
| 755 |
|
| 756 |
} |
| 757 |
}); |
| 758 |
|
| 759 |
|
| 760 |
|
| 761 |
|
| 762 |
|
| 763 |
return _FormSelectWidget; |
| 764 |
}); |