From: Alan Knowles Date: Wed, 2 May 2012 06:09:12 +0000 (+0800) Subject: Roo/form/ComboBoxArray.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=e2f1b3321b60dd668c1d4cefef6355bab4aa60a1 Roo/form/ComboBoxArray.js --- diff --git a/Roo/form/ComboBoxArray.js b/Roo/form/ComboBoxArray.js index 932b7613ef..74556bfa3f 100644 --- a/Roo/form/ComboBoxArray.js +++ b/Roo/form/ComboBoxArray.js @@ -268,24 +268,28 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField, setValue: function(v) // not a valid action - must use addItems.. { - Roo.log(v); + if (this.store.isLocal) { // then we can use the store to find the values.. // comma seperated at present.. this needs to allow JSON based encoding.. this.hiddenField.setValue(v); - var ar = []; - Roo.each(v.split(','), function(v) { + var v_ar = []; + Roo.each(v.split(','), function(k) { + var li = this.store.query(this.store.valueField, k); + if (!li.length) { + return; + } + add = {}; + add[this.store.valueField] = k; + add[this.store.displayField] = li.item(0).data[this.store.displayField]; - - });; - + this.addItem(add); + }, this);; + } - var _this = this; - Roo.each(v, function(l) { - _this.addItem(l); - }); + }, setFromData: function(v)