merge changes for seperator change
authorAlan Knowles <alan@roojs.com>
Wed, 13 May 2020 08:35:23 +0000 (16:35 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 13 May 2020 08:35:23 +0000 (16:35 +0800)
docs/json/roodata.json
docs/src/Roo_form_ComboBoxArray.js.html
docs/symbols/Roo.form.ComboBoxArray.json
roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index dffbb90..8576de9 100644 (file)
         "memberOf" : "Roo.form.TextField"
       },
       {
+        "name" : "seperator",
+        "type" : "String",
+        "desc" : "The value seperator normally ','",
+        "memberOf" : ""
+      },
+      {
         "name" : "tabIndex",
         "type" : "Number",
         "desc" : "The tabIndex for this field. Note this only applies to fields that are rendered, not those which are built via applyTo (defaults to undefined).",
index e1a6c1d..4e3c916 100644 (file)
      * @cfg {String} hiddenName    The hidden name of the field, often contains an comma seperated list of names
      */
     </span><span class="jsdoc-var">hiddenName </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
-
+      </span><span class="jsdoc-comment">/**
+     * @cfg {String} seperator    The value seperator normally ',' 
+     */
+    </span><span class="jsdoc-var">seperator </span><span class="jsdoc-syntax">: </span><span class="jsdoc-string">','</span><span class="jsdoc-syntax">,
 
     </span><span class="jsdoc-comment">// private the array of items that are displayed..
     </span><span class="jsdoc-var">items  </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
         </span><span class="jsdoc-var">this.items.each</span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">f</span><span class="jsdoc-syntax">) {
             </span><span class="jsdoc-var">ar.push</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">f.data</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">idField</span><span class="jsdoc-syntax">]);
         });
-        </span><span class="jsdoc-var">this.hiddenEl.dom.value </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">ar.join</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">','</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-var">this.hiddenEl.dom.value </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">ar.join</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.seperator</span><span class="jsdoc-syntax">);
         </span><span class="jsdoc-var">this.validate</span><span class="jsdoc-syntax">();
     },
 
             // comma seperated at present.. this needs to allow JSON based encoding..
             </span><span class="jsdoc-var">this.hiddenEl.value  </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">v</span><span class="jsdoc-syntax">;
             </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">v_ar </span><span class="jsdoc-syntax">= [];
-            </span><span class="jsdoc-var">Roo.each</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">v.split</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">','</span><span class="jsdoc-syntax">), </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">k</span><span class="jsdoc-syntax">) {
+            </span><span class="jsdoc-var">Roo.each</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">v.split</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.seperator</span><span class="jsdoc-syntax">), </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">k</span><span class="jsdoc-syntax">) {
                 </span><span class="jsdoc-var">Roo.log</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">&quot;CHECK &quot; </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">this.valueField </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-string">',' </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">k</span><span class="jsdoc-syntax">);
                 </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">li </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">this.store.query</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.valueField</span><span class="jsdoc-syntax">, </span><span class="jsdoc-var">k</span><span class="jsdoc-syntax">);
                 </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(!</span><span class="jsdoc-var">li.length</span><span class="jsdoc-syntax">) {
         </span><span class="jsdoc-var">dv </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">typeof</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">dv</span><span class="jsdoc-syntax">) != </span><span class="jsdoc-string">'string' </span><span class="jsdoc-syntax">? </span><span class="jsdoc-string">'' </span><span class="jsdoc-syntax">: </span><span class="jsdoc-var">dv</span><span class="jsdoc-syntax">;
 
 
-        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">keys </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">kv.split</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">','</span><span class="jsdoc-syntax">);
-        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">display </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">dv.split</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">','</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">keys </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">kv.split</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.seperator</span><span class="jsdoc-syntax">);
+        </span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">display </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">dv.split</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.seperator</span><span class="jsdoc-syntax">);
         </span><span class="jsdoc-keyword">for </span><span class="jsdoc-syntax">(</span><span class="jsdoc-keyword">var </span><span class="jsdoc-var">i </span><span class="jsdoc-syntax">= 0 ; </span><span class="jsdoc-var">i </span><span class="jsdoc-syntax">&lt; </span><span class="jsdoc-var">keys.length</span><span class="jsdoc-syntax">; </span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">++) {
-
             </span><span class="jsdoc-var">add </span><span class="jsdoc-syntax">= {};
             </span><span class="jsdoc-var">add</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">this.valueField</span><span class="jsdoc-syntax">] = </span><span class="jsdoc-var">keys</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">];
             </span><span class="jsdoc-var">add</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">this.displayField</span><span class="jsdoc-syntax">] = </span><span class="jsdoc-var">display</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">];
             </span><span class="jsdoc-var">originalValue.push</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">d</span><span class="jsdoc-syntax">[</span><span class="jsdoc-var">i</span><span class="jsdoc-syntax">][</span><span class="jsdoc-var">this.valueField</span><span class="jsdoc-syntax">]);
         }
 
-        </span><span class="jsdoc-keyword">return </span><span class="jsdoc-var">String</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.getValue</span><span class="jsdoc-syntax">()) !== </span><span class="jsdoc-var">String</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">originalValue.join</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">','</span><span class="jsdoc-syntax">));
+        </span><span class="jsdoc-keyword">return </span><span class="jsdoc-var">String</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.getValue</span><span class="jsdoc-syntax">()) !== </span><span class="jsdoc-var">String</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">originalValue.join</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">this.seperator</span><span class="jsdoc-syntax">));
 
     }
 
index eef66ac..6a431d0 100644 (file)
       ]
     },
     {
+      "name" : "seperator",
+      "type" : "String",
+      "desc" : "The value seperator normally ','",
+      "memberOf" : "Roo.form.ComboBoxArray",
+      "values" : [
+      ]
+    },
+    {
       "name" : "fieldClass",
       "type" : "String",
       "desc" : "The default CSS class for the field (defaults to \"x-form-field\")",
index 2310b45..e137848 100644 (file)
@@ -1736,7 +1736,7 @@ if(!this.editable){Roo.get(document).un('keydown',this.listKeyPress,this);}this.
 C=this.store.getAt(ix);if(!C.get(this.displayField)||C.get(this.displayField).substring(0,1).toUpperCase()!=k){C=false;}}this.store.each(function(v){if(C){if(C.id==v.id){C=false;}return;}if(v.get(this.displayField)&&v.get(this.displayField).substring(0,1).toUpperCase()==k){A=this.store.indexOf(v);
 return false;}},this);if(A===false){return true;}this.view.select(A);var sn=Roo.get(this.view.getSelectedNodes()[0]);sn.scrollIntoView(sn.dom.parentNode,false);}});
 // Roo/form/ComboBoxArray.js
-Roo.form.ComboBoxArray=function(A){this.addEvents({'beforeremove':true,'remove':true});Roo.form.ComboBoxArray.superclass.constructor.call(this,A);this.items=new Roo.util.MixedCollection(false);};Roo.extend(Roo.form.ComboBoxArray,Roo.form.TextField,{lastData:false,inputType:'hidden',width:300,name:false,hiddenName:false,items:false,hiddenEl:false,el:false,onRender:function(ct,A){this.combo.hiddenName=this.hiddenName?(this.hiddenName+'-subcombo'):this.hiddenName;
+Roo.form.ComboBoxArray=function(A){this.addEvents({'beforeremove':true,'remove':true});Roo.form.ComboBoxArray.superclass.constructor.call(this,A);this.items=new Roo.util.MixedCollection(false);};Roo.extend(Roo.form.ComboBoxArray,Roo.form.TextField,{lastData:false,inputType:'hidden',width:300,name:false,hiddenName:false,seperator:',',items:false,hiddenEl:false,el:false,onRender:function(ct,A){this.combo.hiddenName=this.hiddenName?(this.hiddenName+'-subcombo'):this.hiddenName;
 this.combo.name=this.name?(this.name+'-subcombo'):this.name;this.combo=Roo.factory(this.combo,Roo.form);this.combo.onRender(ct,A);if(typeof(this.combo.width)!='undefined'){this.combo.onResize(this.combo.width,0);}this.combo.initEvents();this.store=this.combo.store;
 this.valueField=this.combo.valueField;this.displayField=this.combo.displayField;this.combo.wrap.addClass('x-cbarray-grp');var B=this.combo.wrap.createChild({tag:'div',cls:'x-cbarray-cb'},this.combo.el.dom);this.hiddenEl=this.combo.wrap.createChild({tag:'input',type:'hidden',name:this.hiddenName,value:''}
 );this.el=this.combo.wrap.createChild({tag:'input',type:'hidden',name:this.name,value:''});this.outerWrap=this.combo.wrap;this.wrap=B;this.outerWrap.setWidth(this.width);this.outerWrap.dom.removeChild(this.el.dom);this.wrap.dom.appendChild(this.el.dom);this.outerWrap.dom.removeChild(this.combo.trigger.dom);
@@ -1745,14 +1745,14 @@ this.combo.wrap.dom.appendChild(this.combo.trigger.dom);this.combo.trigger.setSt
 },onResize:function(w,h){return;if(typeof w!='number'){return;}var tw=this.combo.trigger.getWidth();tw+=this.addicon?this.addicon.getWidth():0;tw+=this.editicon?this.editicon.getWidth():0;var x=w-tw;this.combo.el.setWidth(this.combo.adjustWidth('input',x));
 this.combo.trigger.setStyle('left','0px');if(this.list&&this.listWidth===undefined){var lw=Math.max(x+this.combo.trigger.getWidth(),this.combo.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},addItem:function(A){var B=this.combo.valueField;
 var C=this.combo.displayField;if(this.items.indexOfKey(A[B])>-1){return;}var x=new Roo.form.ComboBoxArray.Item({data:A,displayField:C,tipField:C,cb:this});this.items.add(A[B],x);this.updateHiddenEl();x.render(this.outerWrap,this.wrap.dom);},updateHiddenEl:function(){this.validate();
-if(!this.hiddenEl){return;}var ar=[];var A=this.combo.valueField;this.items.each(function(f){ar.push(f.data[A]);});this.hiddenEl.dom.value=ar.join(',');this.validate();},reset:function(){this.items.clear();Roo.each(this.outerWrap.select('.x-cbarray-item',true).elements,function(el){el.remove();
-});this.el.dom.value='';if(this.hiddenEl){this.hiddenEl.dom.value='';}},getValue:function(){return this.hiddenEl?this.hiddenEl.dom.value:'';},setValue:function(v){this.reset();if(this.store.isLocal&&(typeof(v)=='string')){this.hiddenEl.value=v;var A=[];Roo.each(v.split(','),function(k){Roo.log("CHECK "+this.valueField+','+k);
+if(!this.hiddenEl){return;}var ar=[];var A=this.combo.valueField;this.items.each(function(f){ar.push(f.data[A]);});this.hiddenEl.dom.value=ar.join(this.seperator);this.validate();},reset:function(){this.items.clear();Roo.each(this.outerWrap.select('.x-cbarray-item',true).elements,function(el){el.remove();
+});this.el.dom.value='';if(this.hiddenEl){this.hiddenEl.dom.value='';}},getValue:function(){return this.hiddenEl?this.hiddenEl.dom.value:'';},setValue:function(v){this.reset();if(this.store.isLocal&&(typeof(v)=='string')){this.hiddenEl.value=v;var A=[];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){return;}var B={};B[this.valueField]=k;B[this.displayField]=li.item(0).data[this.displayField];this.addItem(B);},this)}if(typeof(v)=='object'){Roo.each(v,function(l){this.addItem(l);},this);}},setFromData:function(v){this.reset();
 this.el.dom.value=v[this.displayField];this.hiddenEl.dom.value=v[this.valueField];if(typeof(v[this.valueField])!='string'||!v[this.valueField].length){return;}var kv=v[this.valueField];var dv=v[this.displayField];kv=typeof(kv)!='string'?'':kv;dv=typeof(dv)!='string'?'':dv;
-var A=kv.split(',');var B=dv.split(',');for(var i=0;i<A.length;i++){add={};add[this.valueField]=A[i];add[this.displayField]=B[i];this.addItem(add);}},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getValue()))){this.clearInvalid();
+var A=kv.split(this.seperator);var B=dv.split(this.seperator);for(var i=0;i<A.length;i++){add={};add[this.valueField]=A[i];add[this.displayField]=B[i];this.addItem(add);}},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getValue()))){this.clearInvalid();
 return true;}return false;},validateValue:function(A){return Roo.form.ComboBoxArray.superclass.validateValue.call(this,this.getValue());},isDirty:function(){if(this.disabled){return false;}try{var d=Roo.decode(String(this.originalValue));}catch(e){return String(this.getValue())!==String(this.originalValue);
-}var A=[];for(var i=0;i<d.length;i++){A.push(d[i][this.valueField]);}return String(this.getValue())!==String(A.join(','));}});Roo.form.ComboBoxArray.Item=function(A){A.id=Roo.id();Roo.form.ComboBoxArray.Item.superclass.constructor.call(this,A);};Roo.extend(Roo.form.ComboBoxArray.Item,Roo.BoxComponent,{data:{}
-,cb:false,displayField:false,tipField:false,defaultAutoCreate:{tag:'div',cls:'x-cbarray-item',cn:[{tag:'div'},{tag:'img',width:16,height:16,src:Roo.BLANK_IMAGE_URL,align:'center'}]},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
+}var A=[];for(var i=0;i<d.length;i++){A.push(d[i][this.valueField]);}return String(this.getValue())!==String(A.join(this.seperator));}});Roo.form.ComboBoxArray.Item=function(A){A.id=Roo.id();Roo.form.ComboBoxArray.Item.superclass.constructor.call(this,A);
+};Roo.extend(Roo.form.ComboBoxArray.Item,Roo.BoxComponent,{data:{},cb:false,displayField:false,tipField:false,defaultAutoCreate:{tag:'div',cls:'x-cbarray-item',cn:[{tag:'div'},{tag:'img',width:16,height:16,src:Roo.BLANK_IMAGE_URL,align:'center'}]},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
 if(!this.el){var B=this.getAutoCreate();this.el=ct.createChild(B,A);}this.el.child('img').dom.setAttribute('src',Roo.BLANK_IMAGE_URL);this.el.child('div').dom.innerHTML=this.cb.renderer?this.cb.renderer(this.data):String.format('{0}',this.data[this.displayField]);
 this.el.child('div').dom.setAttribute('qtip',String.format('{0}',this.data[this.tipField]));this.el.child('img').on('click',this.remove,this);},remove:function(){if(this.cb.disabled){return;}if(false!==this.cb.fireEvent('beforeremove',this.cb,this)){this.cb.items.remove(this);
 this.el.child('img').un('click',this.remove,this);this.el.remove();this.cb.updateHiddenEl();this.cb.fireEvent('remove',this.cb,this);}}});
index 1cda431..da9ccc2 100644 (file)
@@ -42318,7 +42318,10 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
      * @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,
@@ -42493,7 +42496,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
         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();
     },
     
@@ -42525,7 +42528,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
             // 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) {
@@ -42564,10 +42567,9 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
         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];
@@ -42615,7 +42617,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
             originalValue.push(d[i][this.valueField]);
         }
         
-        return String(this.getValue()) !== String(originalValue.join(','));
+        return String(this.getValue()) !== String(originalValue.join(this.seperator));
         
     }
     
index b4b532f..5bfabbb 100644 (file)
@@ -19833,7 +19833,10 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
      * @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,
@@ -20008,7 +20011,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
         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();
     },
     
@@ -20040,7 +20043,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
             // 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) {
@@ -20079,10 +20082,9 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
         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];
@@ -20130,7 +20132,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
             originalValue.push(d[i][this.valueField]);
         }
         
-        return String(this.getValue()) !== String(originalValue.join(','));
+        return String(this.getValue()) !== String(originalValue.join(this.seperator));
         
     }
     
index 3295299..2e33893 100644 (file)
@@ -866,7 +866,7 @@ if(!this.editable){Roo.get(document).un('keydown',this.listKeyPress,this);}this.
 C=this.store.getAt(ix);if(!C.get(this.displayField)||C.get(this.displayField).substring(0,1).toUpperCase()!=k){C=false;}}this.store.each(function(v){if(C){if(C.id==v.id){C=false;}return;}if(v.get(this.displayField)&&v.get(this.displayField).substring(0,1).toUpperCase()==k){A=this.store.indexOf(v);
 return false;}},this);if(A===false){return true;}this.view.select(A);var sn=Roo.get(this.view.getSelectedNodes()[0]);sn.scrollIntoView(sn.dom.parentNode,false);}});
 // Roo/form/ComboBoxArray.js
-Roo.form.ComboBoxArray=function(A){this.addEvents({'beforeremove':true,'remove':true});Roo.form.ComboBoxArray.superclass.constructor.call(this,A);this.items=new Roo.util.MixedCollection(false);};Roo.extend(Roo.form.ComboBoxArray,Roo.form.TextField,{lastData:false,inputType:'hidden',width:300,name:false,hiddenName:false,items:false,hiddenEl:false,el:false,onRender:function(ct,A){this.combo.hiddenName=this.hiddenName?(this.hiddenName+'-subcombo'):this.hiddenName;
+Roo.form.ComboBoxArray=function(A){this.addEvents({'beforeremove':true,'remove':true});Roo.form.ComboBoxArray.superclass.constructor.call(this,A);this.items=new Roo.util.MixedCollection(false);};Roo.extend(Roo.form.ComboBoxArray,Roo.form.TextField,{lastData:false,inputType:'hidden',width:300,name:false,hiddenName:false,seperator:',',items:false,hiddenEl:false,el:false,onRender:function(ct,A){this.combo.hiddenName=this.hiddenName?(this.hiddenName+'-subcombo'):this.hiddenName;
 this.combo.name=this.name?(this.name+'-subcombo'):this.name;this.combo=Roo.factory(this.combo,Roo.form);this.combo.onRender(ct,A);if(typeof(this.combo.width)!='undefined'){this.combo.onResize(this.combo.width,0);}this.combo.initEvents();this.store=this.combo.store;
 this.valueField=this.combo.valueField;this.displayField=this.combo.displayField;this.combo.wrap.addClass('x-cbarray-grp');var B=this.combo.wrap.createChild({tag:'div',cls:'x-cbarray-cb'},this.combo.el.dom);this.hiddenEl=this.combo.wrap.createChild({tag:'input',type:'hidden',name:this.hiddenName,value:''}
 );this.el=this.combo.wrap.createChild({tag:'input',type:'hidden',name:this.name,value:''});this.outerWrap=this.combo.wrap;this.wrap=B;this.outerWrap.setWidth(this.width);this.outerWrap.dom.removeChild(this.el.dom);this.wrap.dom.appendChild(this.el.dom);this.outerWrap.dom.removeChild(this.combo.trigger.dom);
@@ -875,14 +875,14 @@ this.combo.wrap.dom.appendChild(this.combo.trigger.dom);this.combo.trigger.setSt
 },onResize:function(w,h){return;if(typeof w!='number'){return;}var tw=this.combo.trigger.getWidth();tw+=this.addicon?this.addicon.getWidth():0;tw+=this.editicon?this.editicon.getWidth():0;var x=w-tw;this.combo.el.setWidth(this.combo.adjustWidth('input',x));
 this.combo.trigger.setStyle('left','0px');if(this.list&&this.listWidth===undefined){var lw=Math.max(x+this.combo.trigger.getWidth(),this.combo.minListWidth);this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth('lr'));}},addItem:function(A){var B=this.combo.valueField;
 var C=this.combo.displayField;if(this.items.indexOfKey(A[B])>-1){return;}var x=new Roo.form.ComboBoxArray.Item({data:A,displayField:C,tipField:C,cb:this});this.items.add(A[B],x);this.updateHiddenEl();x.render(this.outerWrap,this.wrap.dom);},updateHiddenEl:function(){this.validate();
-if(!this.hiddenEl){return;}var ar=[];var A=this.combo.valueField;this.items.each(function(f){ar.push(f.data[A]);});this.hiddenEl.dom.value=ar.join(',');this.validate();},reset:function(){this.items.clear();Roo.each(this.outerWrap.select('.x-cbarray-item',true).elements,function(el){el.remove();
-});this.el.dom.value='';if(this.hiddenEl){this.hiddenEl.dom.value='';}},getValue:function(){return this.hiddenEl?this.hiddenEl.dom.value:'';},setValue:function(v){this.reset();if(this.store.isLocal&&(typeof(v)=='string')){this.hiddenEl.value=v;var A=[];Roo.each(v.split(','),function(k){Roo.log("CHECK "+this.valueField+','+k);
+if(!this.hiddenEl){return;}var ar=[];var A=this.combo.valueField;this.items.each(function(f){ar.push(f.data[A]);});this.hiddenEl.dom.value=ar.join(this.seperator);this.validate();},reset:function(){this.items.clear();Roo.each(this.outerWrap.select('.x-cbarray-item',true).elements,function(el){el.remove();
+});this.el.dom.value='';if(this.hiddenEl){this.hiddenEl.dom.value='';}},getValue:function(){return this.hiddenEl?this.hiddenEl.dom.value:'';},setValue:function(v){this.reset();if(this.store.isLocal&&(typeof(v)=='string')){this.hiddenEl.value=v;var A=[];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){return;}var B={};B[this.valueField]=k;B[this.displayField]=li.item(0).data[this.displayField];this.addItem(B);},this)}if(typeof(v)=='object'){Roo.each(v,function(l){this.addItem(l);},this);}},setFromData:function(v){this.reset();
 this.el.dom.value=v[this.displayField];this.hiddenEl.dom.value=v[this.valueField];if(typeof(v[this.valueField])!='string'||!v[this.valueField].length){return;}var kv=v[this.valueField];var dv=v[this.displayField];kv=typeof(kv)!='string'?'':kv;dv=typeof(dv)!='string'?'':dv;
-var A=kv.split(',');var B=dv.split(',');for(var i=0;i<A.length;i++){add={};add[this.valueField]=A[i];add[this.displayField]=B[i];this.addItem(add);}},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getValue()))){this.clearInvalid();
+var A=kv.split(this.seperator);var B=dv.split(this.seperator);for(var i=0;i<A.length;i++){add={};add[this.valueField]=A[i];add[this.displayField]=B[i];this.addItem(add);}},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getValue()))){this.clearInvalid();
 return true;}return false;},validateValue:function(A){return Roo.form.ComboBoxArray.superclass.validateValue.call(this,this.getValue());},isDirty:function(){if(this.disabled){return false;}try{var d=Roo.decode(String(this.originalValue));}catch(e){return String(this.getValue())!==String(this.originalValue);
-}var A=[];for(var i=0;i<d.length;i++){A.push(d[i][this.valueField]);}return String(this.getValue())!==String(A.join(','));}});Roo.form.ComboBoxArray.Item=function(A){A.id=Roo.id();Roo.form.ComboBoxArray.Item.superclass.constructor.call(this,A);};Roo.extend(Roo.form.ComboBoxArray.Item,Roo.BoxComponent,{data:{}
-,cb:false,displayField:false,tipField:false,defaultAutoCreate:{tag:'div',cls:'x-cbarray-item',cn:[{tag:'div'},{tag:'img',width:16,height:16,src:Roo.BLANK_IMAGE_URL,align:'center'}]},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
+}var A=[];for(var i=0;i<d.length;i++){A.push(d[i][this.valueField]);}return String(this.getValue())!==String(A.join(this.seperator));}});Roo.form.ComboBoxArray.Item=function(A){A.id=Roo.id();Roo.form.ComboBoxArray.Item.superclass.constructor.call(this,A);
+};Roo.extend(Roo.form.ComboBoxArray.Item,Roo.BoxComponent,{data:{},cb:false,displayField:false,tipField:false,defaultAutoCreate:{tag:'div',cls:'x-cbarray-item',cn:[{tag:'div'},{tag:'img',width:16,height:16,src:Roo.BLANK_IMAGE_URL,align:'center'}]},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
 if(!this.el){var B=this.getAutoCreate();this.el=ct.createChild(B,A);}this.el.child('img').dom.setAttribute('src',Roo.BLANK_IMAGE_URL);this.el.child('div').dom.innerHTML=this.cb.renderer?this.cb.renderer(this.data):String.format('{0}',this.data[this.displayField]);
 this.el.child('div').dom.setAttribute('qtip',String.format('{0}',this.data[this.tipField]));this.el.child('img').on('click',this.remove,this);},remove:function(){if(this.cb.disabled){return;}if(false!==this.cb.fireEvent('beforeremove',this.cb,this)){this.cb.items.remove(this);
 this.el.child('img').un('click',this.remove,this);this.el.remove();this.cb.updateHiddenEl();this.cb.fireEvent('remove',this.cb,this);}}});