Roo/form/ComboBoxArray.js
[roojs1] / roojs-ui-debug.js
index 605c2b0..ac2775e 100644 (file)
@@ -23976,6 +23976,11 @@ Roo.form.ComboBoxArray = function(config)
         
     });
     
+    if (!this.hiddenListName && this.hiddenName) {
+        this.hiddenListName = this.hiddenName + '-list';
+    }
+    
+    
 }
  
 Roo.extend(Roo.form.ComboBoxArray, Roo.form.ComboBox,
@@ -23983,15 +23988,24 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.ComboBox,
     lastData : false,
     items  : false,
     
+    
+   /**
+     * @cfg {String} nameField The field to take the 'descriptive' display name from
+     */
     nameField : 'name',
+    /**
+     * @cfg {String} idField The field to take the hidden 'id' data from
+     */
+    idField : 'id',
     
     tipField : 'email',
     
-    idField : 'id',
-    
     renderer : false,
-    
-    hiddenName : false, // set this if you want a , sperated list of values in it for form posting..
+     
+    //hiddenName : false, // set this if you want a , sperated list of values in it for form posting..
+    /**
+     * @cfg {String} hiddenListName The field to take the array of hidden 'id' data that is selected
+     */
     hiddenListName : false,
     hiddenEl : false,
     
@@ -24006,20 +24020,27 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.ComboBox,
     
     onRender : function(ct, position) 
     {
-         
+        if (!this.hiddenName) {
+            Roo.log("ERROR - ComboBox used without a hidden Name..");
+            Roo.log(this);
+        }
+        this.hiddenListName = this.hiddenName;
+        //kludge the naming for the wrapped combo..
+        this.hiddenName += '-lastselected';
+        
         Roo.form.ComboBoxArray.superclass.onRender.call(this, ct, position); 
-        this.wrap.addClass('p-cblist-grp');
+        this.wrap.addClass('x-cbarray-grp');
         var cbwrap = this.wrap.createChild(
-            {tag: 'div', cls: 'p-cblist-cb'},
+            {tag: 'div', cls: 'x-cbarray-cb'},
             this.el.dom
-        );  
-        if (this.hiddenListName) {
+        );
+        
              
-            this.hiddenEl = this.wrap.createChild({
-                tag: 'input',  type:'hidden' , name: this.hiddenListName, value : ''
-            });
+        this.hiddenEl = this.wrap.createChild({
+            tag: 'input',  type:'hidden' , name: this.hiddenListName, value : ''
+        });
          //   this.el.dom.removeAttribute("name");
-        }
+        
         
         this.outerWrap = this.wrap;
         this.wrap = cbwrap;
@@ -24051,6 +24072,15 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.ComboBox,
     },
     
     
+    getName: function()
+    {
+        // returns hidden if it's set..
+        if (!this.rendered) {return ''};
+        return  this.hiddenListName;
+        
+    },
+    
+    
     onResize: function(w, h){
         Roo.form.ComboBox.superclass.onResize.apply(this, arguments);
         
@@ -24168,7 +24198,7 @@ Roo.form.ComboBoxArray.Item = function(config) {
 Roo.extend(Roo.form.ComboBoxArray.Item, Roo.BoxComponent, {
     data : {},
     cb: false,
-    defaultAutoCreate : {tag: 'div', cls: 'p-cblist-item', cn : [ 
+    defaultAutoCreate : {tag: 'div', cls: 'x-cbarray-item', cn : [ 
             { tag: 'div' },
             { tag: 'img', width:16, height : 16, src : Roo.BLANK_IMAGE_URL , align: 'center' }
         ]