X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FComboBoxArray.js;h=9119ab061af7d76cd758db5c421636a6a7b0b34b;hb=66be5b8062e40f71e990833b11f7c695754096cc;hp=932b7613efa1631aff08156357466878fad9fde4;hpb=a3b4e62ea1333d2bb57e984dff7cf7d8dd95d720;p=roojs1 diff --git a/Roo/form/ComboBoxArray.js b/Roo/form/ComboBoxArray.js index 932b7613ef..9119ab061a 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) { + this.hiddenField.el.value = 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)