X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsrc%2FRoo_form_ComboBoxArray.js.html;h=3eaf9911e88e15d8d3731845c177a8ae49af7d9a;hp=e1a6c1da96fe5899bc2bc66f6920e9417d33ef28;hb=0b69a11b1055a6d3a3fd0719bdd58b5a235de0e4;hpb=c4ec853f8b86740a021ea3e6669f2d903878a229 diff --git a/docs/src/Roo_form_ComboBoxArray.js.html b/docs/src/Roo_form_ComboBoxArray.js.html index e1a6c1da96..3eaf9911e8 100644 --- a/docs/src/Roo_form_ComboBoxArray.js.html +++ b/docs/src/Roo_form_ComboBoxArray.js.html @@ -94,7 +94,10 @@ * @cfg {String} hiddenName The hidden name of the field, often contains an comma seperated list of names */ hiddenName : false, - + /** + * @cfg {String} seperator The value seperator normally ',' + */ + seperator : ',', // private the array of items that are displayed.. items : false, @@ -269,7 +272,7 @@ this.items.each(function(f) { ar.push(f.data[idField]); }); - this.hiddenEl.dom.value = ar.join(','); + this.hiddenEl.dom.value = ar.join(this.seperator); this.validate(); }, @@ -301,7 +304,7 @@ // comma seperated at present.. this needs to allow JSON based encoding.. this.hiddenEl.value = v; var v_ar = []; - Roo.each(v.split(','), function(k) { + Roo.each(v.split(this.seperator), function(k) { Roo.log("CHECK " + this.valueField + ',' + k); var li = this.store.query(this.valueField, k); if (!li.length) { @@ -318,7 +321,13 @@ if (typeof(v) == 'object' ) { // then let's assume it's an array of objects.. Roo.each(v, function(l) { - this.addItem(l); + var add = l; + if (typeof(l) == 'string') { + add = {}; + add[this.valueField] = l; + add[this.displayField] = l + } + this.addItem(add); }, this); } @@ -340,10 +349,9 @@ dv = typeof(dv) != 'string' ? '' : dv; - var keys = kv.split(','); - var display = dv.split(','); + var keys = kv.split(this.seperator); + var display = dv.split(this.seperator); for (var i = 0 ; i < keys.length; i++) { - add = {}; add[this.valueField] = keys[i]; add[this.displayField] = display[i]; @@ -391,7 +399,7 @@ originalValue.push(d[i][this.valueField]); } - return String(this.getValue()) !== String(originalValue.join(',')); + return String(this.getValue()) !== String(originalValue.join(this.seperator)); }