Roo/bootstrap/ComboBox.js
[roojs1] / Roo / bootstrap / ComboBox.js
index 4887a6f..59210c4 100644 (file)
@@ -1721,15 +1721,17 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
      * Hides the dropdown list if it is currently expanded. Fires the 'collapse' event on completion.
      */
     collapse : function(){
+        
+        this.hasFocus = false;
+        
         if(!this.isExpanded()){
             return;
         }
         
         this.list.hide();
         
-        this.hasFocus = false;
-        
         if(this.tickable){
+            
             this.okBtn.hide();
             this.cancelBtn.hide();
             this.trigger.show();
@@ -2835,6 +2837,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,