1
|
define([
|
2
|
"dojo/_base/declare",
|
3
|
"dijit/form/FilteringSelect",
|
4
|
"dojo/text!./resources/DropDownBox.html"
|
5
|
], function(declare, FilteringSelect, template){
|
6
|
|
7
|
return declare("steam2.FilteringSelectWithDeselect", [FilteringSelect], {
|
8
|
|
9
|
templateString: template,
|
10
|
|
11
|
postCreate: function(){
|
12
|
this.inherited(arguments);
|
13
|
this.connect(this.deselectNode, "onclick", "_onDeselectClick");
|
14
|
this.toggleDeselectButton();
|
15
|
},
|
16
|
|
17
|
toggleDeselectButton: function(){
|
18
|
if(this.value && !this.disabled){
|
19
|
this.deselectNode.style.display = '';
|
20
|
}
|
21
|
else{
|
22
|
this.deselectNode.style.display = 'none';
|
23
|
}
|
24
|
},
|
25
|
|
26
|
_onDeselectClick: function(/* Event */ e){
|
27
|
this.set('value', '');
|
28
|
},
|
29
|
|
30
|
_setValueAttr: function(val){
|
31
|
this.inherited(arguments);
|
32
|
this.toggleDeselectButton();
|
33
|
},
|
34
|
|
35
|
_setDisabledAttr: function(val){
|
36
|
this.inherited(arguments);
|
37
|
this.toggleDeselectButton();
|
38
|
}
|
39
|
});
|
40
|
});
|