From 91a613e1e0368151145a9eecd66d9c21160e596c Mon Sep 17 00:00:00 2001 From: edward Date: Wed, 25 Apr 2018 17:10:00 +0800 Subject: [PATCH] Roo/bootstrap/ComboBox.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/ComboBox.js | 3 ++- roojs-bootstrap-debug.js | 3 ++- roojs-bootstrap.js | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Roo/bootstrap/ComboBox.js b/Roo/bootstrap/ComboBox.js index eeede96222..314f204a40 100644 --- a/Roo/bootstrap/ComboBox.js +++ b/Roo/bootstrap/ComboBox.js @@ -1143,7 +1143,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { if(typeof(this.loading) !== 'undefined' && this.loading !== null){ this.loading.hide(); } - + Roo.log('onLoad...'); + Roo.log(this.store.getCount()); if(this.store.getCount() > 0){ this.expand(); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 26e2f5a0bc..41c6c84ee8 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -13549,7 +13549,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { if(typeof(this.loading) !== 'undefined' && this.loading !== null){ this.loading.hide(); } - + Roo.log('onLoad...'); + Roo.log(this.store.getCount()); if(this.store.getCount() > 0){ this.expand(); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index c2ea5688ac..79576ac650 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -536,8 +536,8 @@ this.indicator.hide();}},onDestroy:function(){if(this.view){this.view.setStore(n this.store.un('load',this.onLoad,this);this.store.un('loadexception',this.onLoadException,this);}Roo.bootstrap.ComboBox.superclass.onDestroy.call(this);},fireKey:function(e){if(e.isNavKeyPress()&&!this.list.isVisible()){this.fireEvent("specialkey",this,e); }},onResize:function(w,h){},setEditable:function(A){if(A==this.editable){return;}this.editable=A;if(!A){this.inputEl().dom.setAttribute('readOnly',true);this.inputEl().on('mousedown',this.onTriggerClick,this);this.inputEl().addClass('x-combo-noedit');}else{this.inputEl().dom.setAttribute('readOnly',false); this.inputEl().un('mousedown',this.onTriggerClick,this);this.inputEl().removeClass('x-combo-noedit');}},onBeforeLoad:function(A,B){if(!this.hasFocus){return;}if(!B.add){this.list.dom.innerHTML='
  • '+(this.loadingText||'loading')+'
  • '; -}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;}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){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true); +}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;}if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}Roo.log('onLoad...');Roo.log(this.store.getCount());if(this.store.getCount()>0){this.expand(); +this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable&&!this.tickable){this.inputEl().dom.select();}if(!this.selectByValue(this.value,true)&&this.autoFocus&&(!this.store.lastOptions||typeof(this.store.lastOptions.add)=='undefined'||this.store.lastOptions.add!=true)){this.select(0,true); }}else{if(this.autoFocus){this.selectNext();}if(this.typeAhead&&this.lastKey!=Roo.EventObject.BACKSPACE&&this.lastKey!=Roo.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay);}}}else{this.onEmptyResults();}},onLoadException:function(){this.hasQuery=false; if(typeof(this.loading)!=='undefined'&&this.loading!==null){this.loading.hide();}if(this.tickable&&this.editable){return;}this.collapse();},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var A=r.data[this.displayField];var B=A.length; var C=this.getRawValue().length;if(C!=B){this.setRawValue(A);this.selectText(C,A.length);}}},onSelect:function(A,B){if(this.fireEvent('beforeselect',this,A,B)!==false){this.setFromData(B>-1?A.data:false);this.collapse();this.fireEvent('select',this,A,B);} -- 2.39.2