Changeset 500 for Dev/trunk/src/client/qed-client/widgets/ListWidget.js
- Timestamp:
- 03/10/14 16:07:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/widgets/ListWidget.js
r494 r500 14 14 name: "", 15 15 value: null, 16 disabled: false, 17 readOnly: false, 16 18 multiple: true, 17 19 type: "text", … … 20 22 */ 21 23 container: Source, 24 _onChangeActive: false, 22 25 buildRendering: function() { 23 26 this.inherited(arguments); … … 50 53 }); 51 54 this.source = new this.container(this.domNode,sourceParams); 52 this.own(this.source.on('Drop',lang.hitch(this,'_handleChange'))); 55 this.own(this.source.on('Drop', 56 lang.hitch(this,'_handleDrop'))); 57 this.own(on(this.domNode,'change', 58 lang.hitch(this,'_handleChange'))); 53 59 }, 54 60 creator: function(item, hint) { … … 92 98 return this.value; 93 99 }, 94 _setValueAttr: function(value ) {100 _setValueAttr: function(value,priorityChange) { 95 101 this.clear(); 96 102 this.appendItems(value || []); … … 158 164 this.inherited(arguments); 159 165 }, 160 _handleChange: function() { 161 this.value = this._getValueAttr(); 162 this.onChange(this.value); 166 _handleChange: function(evt) { 167 if ( evt.target !== this.domNode ) { 168 if ( this._onChangeActive && !(this.readOnly || this.disabled) ) { 169 this.emit('change',this.get('value')); 170 } 171 if ( evt ) { event.stop(evt); } 172 return false; 173 } 174 return true; 163 175 }, 164 onChange: function(value) {} 176 _handleDrop: function() { 177 if ( this._onChangeActive && !(this.readOnly || this.disabled) ) { 178 this.emit('change',this.get('value')); 179 } 180 } 165 181 }); 166 182 });
Note: See TracChangeset
for help on using the changeset viewer.