Roo/bootstrap/ComboBox.js
authorEdward <edward@roojs.com>
Fri, 16 May 2014 06:07:15 +0000 (14:07 +0800)
committerEdward <edward@roojs.com>
Fri, 16 May 2014 06:07:15 +0000 (14:07 +0800)
Roo/bootstrap/ComboBox.js

index 257d73f..516d2b9 100644 (file)
@@ -23,6 +23,82 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.Input, {
     
     getAutoCreate : function(){
         
+        var align = (!this.labelAlign) ? this.parentLabelAlign() : this.labelAlign;
+        
+        
+        var cfg = {};
+        
+        if(this.multiple){
+            cfg = this.getAutoCreateMulitple();
+            return cfg;
+        }
+        
+        var id = Roo.id();
+        
+        var cfg = {
+            tag: 'div',
+            cn: [
+                {
+                    tag: 'div',
+                    cls: 'select2-container',
+                    cn: [
+                        {
+                            tag: 'a',
+                            cls: 'select2-choice',
+                            tabindex: -1,
+                            cn: [
+                                {
+                                    tag: 'span',
+                                    cls: 'select2-chosen'
+                                },
+                                {
+                                    tag: 'abbr',
+                                    cls: 'select2-search-choice-close'
+                                },
+                                {
+                                    tag: 'span',
+                                    cls: 'select2-arrow',
+                                    role: 'presentation',
+                                    cn: [
+                                        {
+                                            tag: 'b',
+                                            role: 'presentation'
+                                        }
+                                    ]
+                                }
+                            ]
+                        },
+                        {
+                            tag: 'label',
+                            'for': id,
+                            cls: 'select2-offscreen'
+                        },
+                        {
+                            tag: 'input',
+                            cls: 'select2-focusser select2-offscreen',
+                            type: 'text',
+                            role: 'button',
+                            id: id,
+                            tabindex: 0
+                        }
+                    ]
+
+                },
+                {
+                    tag: 'select',
+                    cls: 'select2-offscreen',
+                    tabindex: -1
+                }
+            ]
+        };
+        
+        Roo.log(cfg)
+        return cfg;
+        
+    },
+    
+    getAutoCreateMulitple : function()
+    {
         var id = Roo.id();
         
         var cfg = {
@@ -74,12 +150,6 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.Input, {
         };
         
         return cfg;
-        
-    },
-    
-    getAutoCreateMulitple : function()
-    {
-        
     }
     
 });
\ No newline at end of file