roojs-bootstrap.js
authorleon <leon@roojs.com>
Fri, 23 Sep 2022 05:29:29 +0000 (13:29 +0800)
committerleon <leon@roojs.com>
Fri, 23 Sep 2022 05:29:29 +0000 (13:29 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index ef90b66..58be41b 100644 (file)
@@ -9505,7 +9505,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     
     initCSS : function()
     {
-        
+        if(this.disableAutoSize) {
+            Roo.log("DISABLEINITCSS");
+            return;
+        }
         
         var cm = this.cm, styles = [];
         this.CSS.removeStyleSheet(this.id + '-cssrules');
index 934f0a3..91228a5 100644 (file)
@@ -404,27 +404,28 @@ if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select
 );}this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('update',this.onUpdate,this);this.store.on('add',this.onAdd,this);this.store.on("clear",this.clear,this);this.el.on("contextmenu",this.onContextMenu,this);
 this.cm.on("headerchange",this.onHeaderChange,this);this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);this.bodyEl.on("click",this.onClick,this);this.bodyEl.on("dblclick",this.onDblClick,this);this.bodyEl.on('scroll',this.onBodyScroll,this);this.relayEvents(this.bodyEl,["mousedown","mouseup","mouseover","mouseout","keypress"]);
 this.resizeProxy=Roo.get(document.body).createChild({cls:"x-grid-resize-proxy",html:'&#160;'});if(this.headEl&&this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,false);}this.initCSS();},getView:function(){return this;
-},initCSS:function(){var cm=this.cm,A=[];this.CSS.removeStyleSheet(this.id+'-cssrules');var B=this.headEl?this.headEl.dom.clientHeight:0;var sz=Roo.getGridSize();var C=0;var D=-1;var E=[];var F=0;for(var i=0,G=cm.getColumnCount();i<G;i++){var w=cm.getColumnWidth(i,false);
-if(cm.isHidden(i)){E.push({rel:false,abs:0});continue;}if(w!==false){E.push({rel:false,abs:w});F+=w;D=i;continue;}var w=cm.getColumnWidth(i,sz);if(w>0){D=i}C+=w;E.push({rel:w,abs:false});}var H=this.bodyEl.dom.clientWidth-F;var I=Math.floor(H/C);var J=H-(I*C);
-var K,L,M=0,N,O;for(var i=0,G=cm.getColumnCount();i<G;i++){K='display:none;';O='';L='width:0px;';N='';if(!cm.isHidden(i)){K='';var w=E[i].rel==false?E[i].abs:(E[i].rel*I);if(w===0){K='display:none;';}if(i==D){w+=J;}M+=w;O="left:"+(M-4)+"px;";L="width:"+w+"px;";
-}if(this.responsive){L='';O='';K=cm.isHidden(i)?'display:none;':'';N='display: none;';}A.push('#',this.id,' .x-col-',i," {",cm.config[i].css,L,K,"}\n");if(this.headEl){if(i==D){N='display:none;';}A.push('#',this.id,' .x-hcol-',i," { ",L,K," }\n",'#',this.id,' .x-grid-split-',i," { ",O,N,'height:',(B-4),"px;}\n",'.popover-inner #',this.id,' .x-grid-split-',i," { ",O,N,'height:',100,"%;}\n");
-}}this.CSS.createStyleSheet(A.join(''),this.id+'-cssrules');},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var B=Roo.get(t);if(!B){return;}if(B.findParent('tfoot',false,true)){return;
-}if(B.findParent('thead',false,true)){if(e.getTarget().nodeName.toLowerCase()!='th'){B=Roo.get(t).findParent('th',false,true);if(!B){Roo.log("failed to find th in thead?");Roo.log(e.getTarget());return;}}var C=B.dom.cellIndex;var D=A=='touchstart'?'click':A;
-this.fireEvent("header"+D,this,C,e);return;}if(e.getTarget().nodeName.toLowerCase()!='td'){B=Roo.get(t).findParent('td',false,true);if(!B){Roo.log("failed to find th in tbody?");Roo.log(e.getTarget());return;}}var E=B.findParent('tr',false,true);var C=B.dom.cellIndex;
-var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==false){this.fireEvent("cell"+A,this,F,C,e);}}},onMouseover:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
-}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseover',this,A,D,C,e);},onMouseout:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
-}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseout',this,A,D,C,e);},onClick:function(e,el){var A=Roo.get(el);if(!A||(!this.cellSelection&&!this.rowSelection)){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);
-}if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);this.fireEvent('cellclick',this,A,D,C,e);this.fireEvent('rowclick',this,B,D,e);},onDblClick:function(e,el){var A=Roo.get(el);
-if(!A||(!this.cellSelection&&!this.rowSelection)){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;
-var D=this.getRowIndex(B);if(this.cellSelection){this.fireEvent('celldblclick',this,A,D,C,e);}if(this.rowSelection){this.fireEvent('rowdblclick',this,B,D,e);}},findRowIndex:function(el){var A=Roo.get(el);if(!A){return false;}var B=A.findParent('tr',false,true);
-if(!B||typeof(B)=='undefined'){return false;}return this.getRowIndex(B);},sort:function(e,el){var A=Roo.get(el);if(!A.hasClass('sortable')){return;}var B=A.attr('sort');var C='ASC';if(A.select('i',true).first().hasClass('fa-arrow-up')){C='DESC';}this.store.sortInfo={field:B,direction:C}
-;if(this.footer){Roo.log("calling footer first");this.footer.onClick('first');}else{this.store.load({params:{start:0}});}},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;this.totalWidth=0;for(var i=0,B=cm.getColumnCount();i<B;i++){var C=cm.config[i];
-var c={tag:'th',cls:'x-hcol-'+i,style:'',html:cm.getColumnHeader(i)};var D=cm.getColumnTooltip(i);if(D){c.tooltip=D;}var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls+=' sortable';c.html='<i class="fa"></i>'+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-md ">'+C.lgHeader+'</span>';
-}if(typeof(C.mdHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-lg">'+C.mdHeader+'</span>';}if(typeof(C.smHeader)!='undefined'){hh+='<span class="hidden-xs hidden-md hidden-lg">'+C.smHeader+'</span>';}if(typeof(C.xsHeader)!='undefined'){hh+='<span class="hidden-sm hidden-md hidden-lg">'+C.xsHeader+'</span>';
-}if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip;}if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';';
-}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}if(this.responsive){['xs','sm','md','lg'].map(function(E){if(typeof(C[E])=='undefined'){return;}if(!C[E]){c.cls+=' hidden-'+E+' hidden'+E+'-down';return;}c.cls+=' col-'+E+'-'+C[E]+(E=='xs'?(' col-'+C[E]):'');
-});}c.html+=' <span class="x-grid-split x-grid-split-'+i+'"></span>';A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}
-]}]};return A;},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['fa-arrow-up','fa-arrow-down']);if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['fa-arrow-up']);
+},initCSS:function(){if(this.disableAutoSize){Roo.log("DISABLEINITCSS");return;}var cm=this.cm,A=[];this.CSS.removeStyleSheet(this.id+'-cssrules');var B=this.headEl?this.headEl.dom.clientHeight:0;var sz=Roo.getGridSize();var C=0;var D=-1;var E=[];var F=0;
+for(var i=0,G=cm.getColumnCount();i<G;i++){var w=cm.getColumnWidth(i,false);if(cm.isHidden(i)){E.push({rel:false,abs:0});continue;}if(w!==false){E.push({rel:false,abs:w});F+=w;D=i;continue;}var w=cm.getColumnWidth(i,sz);if(w>0){D=i}C+=w;E.push({rel:w,abs:false}
+);}var H=this.bodyEl.dom.clientWidth-F;var I=Math.floor(H/C);var J=H-(I*C);var K,L,M=0,N,O;for(var i=0,G=cm.getColumnCount();i<G;i++){K='display:none;';O='';L='width:0px;';N='';if(!cm.isHidden(i)){K='';var w=E[i].rel==false?E[i].abs:(E[i].rel*I);if(w===0){K='display:none;';
+}if(i==D){w+=J;}M+=w;O="left:"+(M-4)+"px;";L="width:"+w+"px;";}if(this.responsive){L='';O='';K=cm.isHidden(i)?'display:none;':'';N='display: none;';}A.push('#',this.id,' .x-col-',i," {",cm.config[i].css,L,K,"}\n");if(this.headEl){if(i==D){N='display:none;';
+}A.push('#',this.id,' .x-hcol-',i," { ",L,K," }\n",'#',this.id,' .x-grid-split-',i," { ",O,N,'height:',(B-4),"px;}\n",'.popover-inner #',this.id,' .x-grid-split-',i," { ",O,N,'height:',100,"%;}\n");}}this.CSS.createStyleSheet(A.join(''),this.id+'-cssrules');
+},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var B=Roo.get(t);if(!B){return;}if(B.findParent('tfoot',false,true)){return;}if(B.findParent('thead',false,true)){if(e.getTarget().nodeName.toLowerCase()!='th'){B=Roo.get(t).findParent('th',false,true);
+if(!B){Roo.log("failed to find th in thead?");Roo.log(e.getTarget());return;}}var C=B.dom.cellIndex;var D=A=='touchstart'?'click':A;this.fireEvent("header"+D,this,C,e);return;}if(e.getTarget().nodeName.toLowerCase()!='td'){B=Roo.get(t).findParent('td',false,true);
+if(!B){Roo.log("failed to find th in tbody?");Roo.log(e.getTarget());return;}}var E=B.findParent('tr',false,true);var C=B.dom.cellIndex;var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==false){this.fireEvent("cell"+A,this,F,C,e);
+}}},onMouseover:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseover',this,A,D,C,e);
+},onMouseout:function(e,el){var A=Roo.get(el);if(!A){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}var B=A.findParent('tr',false,true);var C=A.dom.cellIndex;var D=B.dom.rowIndex-1;this.fireEvent('mouseout',this,A,D,C,e);
+},onClick:function(e,el){var A=Roo.get(el);if(!A||(!this.cellSelection&&!this.rowSelection)){return;}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);
+if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);this.fireEvent('cellclick',this,A,D,C,e);this.fireEvent('rowclick',this,B,D,e);},onDblClick:function(e,el){var A=Roo.get(el);if(!A||(!this.cellSelection&&!this.rowSelection)){return;
+}if(e.getTarget().nodeName.toLowerCase()!='td'){A=A.findParent('td',false,true);}if(!A||typeof(A)=='undefined'){return;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return;}var C=A.dom.cellIndex;var D=this.getRowIndex(B);if(this.cellSelection){this.fireEvent('celldblclick',this,A,D,C,e);
+}if(this.rowSelection){this.fireEvent('rowdblclick',this,B,D,e);}},findRowIndex:function(el){var A=Roo.get(el);if(!A){return false;}var B=A.findParent('tr',false,true);if(!B||typeof(B)=='undefined'){return false;}return this.getRowIndex(B);},sort:function(e,el){var A=Roo.get(el);
+if(!A.hasClass('sortable')){return;}var B=A.attr('sort');var C='ASC';if(A.select('i',true).first().hasClass('fa-arrow-up')){C='DESC';}this.store.sortInfo={field:B,direction:C};if(this.footer){Roo.log("calling footer first");this.footer.onClick('first');}else{this.store.load({params:{start:0}
+});}},renderHeader:function(){var A={tag:'thead',cn:[]};var cm=this.cm;this.totalWidth=0;for(var i=0,B=cm.getColumnCount();i<B;i++){var C=cm.config[i];var c={tag:'th',cls:'x-hcol-'+i,style:'',html:cm.getColumnHeader(i)};var D=cm.getColumnTooltip(i);if(D){c.tooltip=D;
+}var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls+=' sortable';c.html='<i class="fa"></i>'+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-md ">'+C.lgHeader+'</span>';}if(typeof(C.mdHeader)!='undefined'){hh+='<span class="hidden-xs hidden-sm hidden-lg">'+C.mdHeader+'</span>';
+}if(typeof(C.smHeader)!='undefined'){hh+='<span class="hidden-xs hidden-md hidden-lg">'+C.smHeader+'</span>';}if(typeof(C.xsHeader)!='undefined'){hh+='<span class="hidden-sm hidden-md hidden-lg">'+C.xsHeader+'</span>';}if(hh.length){c.html=hh;}if(typeof(C.tooltip)!='undefined'){c.tooltip=C.tooltip;
+}if(typeof(C.colspan)!='undefined'){c.colspan=C.colspan;}if(typeof(C.dataIndex)!='undefined'){c.sort=C.dataIndex;}if(typeof(C.align)!='undefined'&&C.align.length){c.style+=' text-align:'+C.align+';';}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);
+}if(this.responsive){['xs','sm','md','lg'].map(function(E){if(typeof(C[E])=='undefined'){return;}if(!C[E]){c.cls+=' hidden-'+E+' hidden'+E+'-down';return;}c.cls+=' col-'+E+'-'+C[E]+(E=='xs'?(' col-'+C[E]):'');});}c.html+=' <span class="x-grid-split x-grid-split-'+i+'"></span>';
+A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;},renderFooter:function(){var A={tag:'tfoot',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A;
+},onLoad:function(){this.clear();var A=this;var cm=this.cm;var ds=this.store;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.select('i',true).removeClass(['fa-arrow-up','fa-arrow-down']);if(A.store.sortInfo){if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='ASC'){e.select('i',true).addClass(['fa-arrow-up']);
 }if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['fa-arrow-down']);}}});var B=this.bodyEl;if(ds.getCount()>0){ds.data.each(function(d,E){var F=this.renderRow(cm,ds,E);
 B.createChild(F);var G=this;if(F.cellObjects.length){Roo.each(F.cellObjects,function(r){G.renderCellObject(r);})}},this);}else if(this.empty_results.length){this.el.mask(this.empty_results,'no-spinner');}var C=this.el.select('tfoot',true).first();if(this.footerShow&&this.auto_hide_footer&&this.mainFoot){this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide();
 var D=this.ds.getTotalCount();if(this.footer.pageSize<D){this.mainFoot.show();}}Roo.each(this.el.select('tbody td',true).elements,function(e){e.on('mouseover',A.onMouseover,A);});Roo.each(this.el.select('tbody td',true).elements,function(e){e.on('mouseout',A.onMouseout,A);