From b7413fd43e33a66e14567b0f0f33561d275baf2a Mon Sep 17 00:00:00 2001 From: edward Date: Wed, 25 Apr 2018 16:59:50 +0800 Subject: [PATCH] Roo/bootstrap/ComboBox.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/ComboBox.js | 2 +- roojs-bootstrap-debug.js | 4 ++-- roojs-bootstrap.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Roo/bootstrap/ComboBox.js b/Roo/bootstrap/ComboBox.js index b1dca24152..c453a42aba 100644 --- a/Roo/bootstrap/ComboBox.js +++ b/Roo/bootstrap/ComboBox.js @@ -1139,7 +1139,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { if(!this.hasFocus){ return; } - + Roo.log('run??'); if(typeof(this.loading) !== 'undefined' && this.loading !== null){ this.loading.hide(); } diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index ffc9192a2e..8f86e648b7 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -13545,7 +13545,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { if(!this.hasFocus){ return; } - + Roo.log('run??'); if(typeof(this.loading) !== 'undefined' && this.loading !== null){ this.loading.hide(); } @@ -14063,7 +14063,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { if(this.lastQuery != q || this.alwaysQuery){ this.lastQuery = q; if(this.mode == 'local'){ - Roo.log('it is local'); + this.selectedIndex = -1; if(forceAll){ this.store.clearFilter(); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 2ffac30e15..aa9e285cbd 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -536,7 +536,7 @@ 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(); +}this.restrictHeight();this.selectedIndex=-1;},onLoad:function(){this.hasQuery=false;if(!this.hasFocus){return;}Roo.log('run??');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); }}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; @@ -559,8 +559,8 @@ if(r){this.select(this.store.indexOf(r),A);return true;}}return false;},select:f if(ct>0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex0){if(this.selectedIndex==-1){this.select(0);}else if(this.selectedIndex!=0){this.select(this.selectedIndex-1); }}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay);}},validateBlur:function(){return !this.list||!this.list.isVisible();},initQuery:function(){var v=this.getRawValue();if(this.tickable&&this.editable){v=this.tickableInputEl().getValue(); }this.doQuery(v);},doForce:function(){if(this.inputEl().dom.value.length>0){this.inputEl().dom.value=this.lastSelectionText===undefined?'':this.lastSelectionText;}},doQuery:function(q,A){if(q===undefined||q===null){q='';}var qe={query:q,forceAll:A,combo:this,cancel:false} -;if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}q=qe.query;A=qe.forceAll;if(A===true||(q.length>=this.minChars)){this.hasQuery=true;if(this.lastQuery!=q||this.alwaysQuery){this.lastQuery=q;if(this.mode=='local'){Roo.log('it is local'); -this.selectedIndex=-1;if(A){this.store.clearFilter();}else{if(this.specialFilter){this.fireEvent('specialfilter',this);this.onLoad();return;}this.store.filter(this.displayField,q);}this.store.fireEvent("datachanged",this.store);this.onLoad();}else{this.store.baseParams[this.queryParam]=q; +;if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}q=qe.query;A=qe.forceAll;if(A===true||(q.length>=this.minChars)){this.hasQuery=true;if(this.lastQuery!=q||this.alwaysQuery){this.lastQuery=q;if(this.mode=='local'){this.selectedIndex=-1; +if(A){this.store.clearFilter();}else{if(this.specialFilter){this.fireEvent('specialfilter',this);this.onLoad();return;}this.store.filter(this.displayField,q);}this.store.fireEvent("datachanged",this.store);this.onLoad();}else{this.store.baseParams[this.queryParam]=q; var B={params:this.getParams(q)};if(this.loadNext){B.add=true;B.params.start=this.page*this.pageSize;}this.store.load(B);}}else{this.selectedIndex=-1;this.onLoad();}}this.loadNext=false;},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize; }return p;},collapse:function(){if(!this.isExpanded()){return;}this.list.hide();this.hasFocus=false;if(this.tickable){this.okBtn.hide();this.cancelBtn.hide();this.trigger.show();if(this.editable){this.tickableInputEl().dom.value='';this.tickableInputEl().blur(); }}Roo.get(document).un('mousedown',this.collapseIf,this);Roo.get(document).un('mousewheel',this.collapseIf,this);if(!this.editable){Roo.get(document).un('keydown',this.listKeyPress,this);}this.fireEvent('collapse',this);this.validate();},collapseIf:function(e){var A=e.within(this.el); -- 2.39.2