From df0f81190a21a3a517a100ce13fc5bf910d2675e Mon Sep 17 00:00:00 2001 From: john Date: Mon, 26 Mar 2018 13:36:21 +0800 Subject: [PATCH] Roo/bootstrap/ComboBox.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/ComboBox.js | 2 ++ roojs-bootstrap-debug.js | 3 ++- roojs-bootstrap.js | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Roo/bootstrap/ComboBox.js b/Roo/bootstrap/ComboBox.js index 4887a6fbe8..fb9ceb5c74 100644 --- a/Roo/bootstrap/ComboBox.js +++ b/Roo/bootstrap/ComboBox.js @@ -1337,6 +1337,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { */ setFromData : function(o){ + Roo.log(o); + if(this.multiple){ this.addItem(o); return; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index e6ae4c0972..bba6254190 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -10936,7 +10936,6 @@ Roo.extend(Roo.data.Store, Roo.util.Observable, { this.data.insert(index, records[i]); records[i].join(this); } - Roo.log(records); this.fireEvent("add", this, records, index); }, @@ -13731,6 +13730,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, { */ setFromData : function(o){ + Roo.log(o); + if(this.multiple){ this.addItem(o); return; diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 71b683a9e6..57e975adea 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -433,7 +433,7 @@ delete A.data;}Roo.apply(this,A);if(this.reader){this.reader=Roo.factory(this.re }}if(this.recordType){this.fields=this.recordType.prototype.fields;}this.modified=[];this.addEvents({datachanged:true,metachange:true,add:true,remove:true,update:true,clear:true,beforeload:true,beforeloadadd:true,load:true,loadexception:true});if(this.proxy){this.proxy=Roo.factory(this.proxy,Roo.data); this.proxy.xmodule=this.xmodule||false;this.relayEvents(this.proxy,["loadexception"]);}this.sortToggle={};this.sortOrder=[];Roo.data.Store.superclass.constructor.call(this);if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData;}};Roo.extend(Roo.data.Store,Roo.util.Observable,{multiSort:false,remoteSort:false,pruneModifiedRecords:false,lastOptions:null,add:function(A){A=[].concat(A); for(var i=0,B=A.length;i0))?B.show():B.hide();}this.validate();},lastData:false,setFromData:function(o){if(this.multiple){this.addItem(o);return;}var dv=''; -var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else{Roo.log('no displayField value set for '+(this.name?this.name:this.id));}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField]; +}Roo.bootstrap.ComboBox.superclass.setValue.call(this,A);this.value=v;var B=this.closeTriggerEl();if(B){(v&&(v.length||v*1>0))?B.show():B.hide();}this.validate();},lastData:false,setFromData:function(o){Roo.log(o);if(this.multiple){this.addItem(o);return; +}var dv='';var vv='';this.lastData=o;if(this.displayField){dv=!o||typeof(o[this.displayField])=='undefined'?'':o[this.displayField];}else{Roo.log('no displayField value set for '+(this.name?this.name:this.id));}if(this.valueField){vv=!o||typeof(o[this.valueField])=='undefined'?dv:o[this.valueField]; }var A=this.closeTriggerEl();if(A){if(dv.length||vv*1>0){A.show();this.blockFocus=true;}else{A.hide();}}if(this.hiddenField){this.hiddenField.dom.value=vv;this.lastSelectionText=dv;Roo.bootstrap.ComboBox.superclass.setValue.call(this,dv);this.value=vv;return; }this.lastSelectionText=dv;Roo.bootstrap.ComboBox.superclass.setValue.call(this,dv);this.value=vv;},reset:function(){if(this.multiple){this.clearItem();return;}this.setValue(this.originalValue);this.lastData=false;if(this.view){this.view.clearSelections(); }this.validate();},findRecord:function(A,B){var C;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[A]==B){C=r;return false;}return true;});}return C;},getName:function(){if(!this.rendered){return ''};return !this.hiddenName&&this.inputEl().dom.name?this.inputEl().dom.name:(this.hiddenName||''); -- 2.39.2