Roo/bootstrap/ComboBox.js
[roojs1] / Roo / bootstrap / ComboBox.js
index 0d2c57f..4d6be4a 100644 (file)
@@ -647,6 +647,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             throw "can not find store for combo";
         }
         
+        this.indicator = this.indicatorEl();
+        
         this.store = Roo.factory(this.store, Roo.data);
         this.store.parent = this;
         
@@ -1728,6 +1730,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         this.hasFocus = false;
         
         if(this.tickable){
+            
             this.okBtn.hide();
             this.cancelBtn.hide();
             this.trigger.show();
@@ -1860,7 +1863,11 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
     
     onSearchFieldClick : function(e)
     {
+        Roo.log('in???');
+        Roo.log([this.hasFocus, e.getTarget().nodeName.toLowerCase() ]);
+        
         if(this.hasFocus && !this.disabled && e.getTarget().nodeName.toLowerCase() != 'button'){
+            Roo.log('onSearchFieldClick');
             this.onTickableFooterButtonClick(e, false, false);
             return;
         }
@@ -2343,29 +2350,35 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             
             var labelCfg = cfg.cn[1];
             var contentCfg = cfg.cn[2];
+            
 
             if(this.indicatorpos == 'right'){
-    
                 cfg.cn = [
                     {
                         tag: 'label',
+                        'for' :  id,
                         cls : 'control-label',
-                        html : this.fieldLabel,
                         cn : [
                             {
-                               tag : 'i',
-                               cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
-                               tooltip : 'This field is required'
+                                tag : 'span',
+                                html : this.fieldLabel
+                            },
+                            {
+                                tag : 'i',
+                                cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+                                tooltip : 'This field is required'
                             }
                         ]
                     },
                     {
-                        cls : '', 
+                        cls : "",
                         cn: [
                             combobox
                         ]
                     }
+
                 ];
+                
                 labelCfg = cfg.cn[0];
                 contentCfg = cfg.cn[1];
             }
@@ -2827,6 +2840,14 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             
             var default_text = '-- SELECT --';
             
+            if(this.placeholder.length){
+                default_text = this.placeholder;
+            }
+            
+            if(this.emptyTitle.length){
+                default_text += ' - ' + this.emptyTitle + ' -';
+            }
+            
             var opt = this.inputEl().createChild({
                 tag: 'option',
                 value : 0,