sync
[roojs1] / Roo / bootstrap / ComboBox.js
index 225461f..a5b7622 100644 (file)
@@ -16,6 +16,7 @@
  * @cfg {Boolean} animate default true
  * @cfg {Boolean} emptyResultText only for touch device
  * @cfg {String} triggerText multiple combobox trigger button text default 'Select'
+ * @cfg {String} emptyTitle default ''
  * @constructor
  * Create a new ComboBox.
  * @param {Object} config Configuration options
@@ -336,6 +337,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
     animate : true,
     emptyResultText: 'Empty',
     triggerText : 'Select',
+    emptyTitle : '',
     
     // element that contains real text value.. (when hidden is used..)
     
@@ -366,10 +368,6 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
          */
         if(!this.tickable){
             cfg = Roo.bootstrap.ComboBox.superclass.getAutoCreate.call(this);
-            if(this.name == 'info_year_invest_id_display_name'){
-                Roo.log('cfg.................................................');
-                Roo.log(cfg);
-            }
             return cfg;
         }
         
@@ -526,8 +524,11 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                         tag: 'label',
                         'for' :  id,
                         cls : 'control-label',
-                        html : this.fieldLabel,
                         cn : [
+                            {
+                                tag : 'span',
+                                html : this.fieldLabel
+                            },
                             {
                                 tag : 'i',
                                 cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
@@ -535,7 +536,6 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                             }
                         ]
                     },
-                    
                     {
                         cls : "",
                         cn: [
@@ -545,8 +545,10 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
 
                 ];
                 
+                
+                
                 labelCfg = cfg.cn[0];
-                contentCfg = cfg.cn[2];
+                contentCfg = cfg.cn[1];
             
             }
             
@@ -591,35 +593,25 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                         tag: 'label',
                         //cls : 'input-group-addon',
                         html : this.fieldLabel
-                        
                     },
-                    
                     combobox
-                    
                 ];
                 
                 if(this.indicatorpos == 'right'){
-                    
                     cfg.cn = [
                         {
                             tag: 'label',
                             //cls : 'input-group-addon',
-                            html : this.fieldLabel,
-                            cn : [
-                                {
-                                    tag : 'i',
-                                    cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
-                                    tooltip : 'This field is required'
-                                }
-                            ]
+                            html : this.fieldLabel
+                        },
+                        {
+                            tag : 'i',
+                            cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                            tooltip : 'This field is required'
                         },
-                        
-                        
-                        
                         combobox
-
                     ];
-                
+                    
                 }
 
         } else {
@@ -656,6 +648,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         }
         
         this.store = Roo.factory(this.store, Roo.data);
+        this.store.parent = this;
         
         // if we are building from html. then this element is so complex, that we can not really
         // use the rendered HTML.
@@ -789,7 +782,6 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         this.view.on('click', this.onViewClick, this);
         
         
-        
         this.store.on('beforeload', this.onBeforeLoad, this);
         this.store.on('load', this.onLoad, this);
         this.store.on('loadexception', this.onLoadException, this);
@@ -1154,8 +1146,9 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         if(typeof(this.loading) !== 'undefined' && this.loading !== null){
             this.loading.hide();
         }
-             
+        
         if(this.store.getCount() > 0){
+            
             this.expand();
             this.restrictHeight();
             if(this.lastQuery == this.allQuery){
@@ -1995,7 +1988,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
                 {
                     tag: 'a',
                     href: '#',
-                    cls: 'roo-select2-search-choice-close',
+                    cls: 'roo-select2-search-choice-close fa fa-times',
                     tabindex: '-1'
                 }
             ]