Mercurial > lada > lada-client
comparison app/view/widget/Netzbetreiber.js @ 1080:15d7b7a9e177
Override getValue for Netzbetreiber Combobox to allways return the correct
value.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 13 Apr 2016 16:10:25 +0200 |
parents | 95d40ca7bb70 |
children | f5cc079cd683 |
comparison
equal
deleted
inserted
replaced
1079:1c86a259c2ac | 1080:15d7b7a9e177 |
---|---|
32 } | 32 } |
33 else { | 33 else { |
34 this.store.clearFilter(); | 34 this.store.clearFilter(); |
35 } | 35 } |
36 this.callParent(arguments); | 36 this.callParent(arguments); |
37 }, | |
38 | |
39 getValue: function() { | |
40 var value = this.down('combobox').getValue(); | |
41 if (value instanceof Array) { | |
42 return value; | |
43 } | |
44 value = value.trim().split(' '); | |
45 var retValues = []; | |
46 for (var i = 0; i < value.length; i++) { | |
47 var item = value[i]; | |
48 var found = this.store.queryBy(function(rec) { | |
49 if (rec.get('id') == item || | |
50 rec.get('netzbetreiber') == item) { | |
51 return true; | |
52 } | |
53 }); | |
54 if (found.getCount() >= 0) { | |
55 retValues.push(found.getAt(0).get('id')); | |
56 continue; | |
57 } | |
58 } | |
59 return retValues; | |
37 } | 60 } |
38 }); | 61 }); |