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

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

index ad7239f..ef90b66 100644 (file)
@@ -9165,6 +9165,7 @@ Currently the Table  uses multiple headers to try and handle XL / Medium etc...
  * @cfg {Boolean} lazyLoad  auto load data while scrolling to the end (default false)
  * @cfg {Boolean} auto_hide_footer  auto hide footer if only one page (default false)
  * @cfg {Boolean} enableColumnResize default true if columns can be resized = needs scrollBody to be set to work (drag/drop)
+ * @cfg {Boolean} disableAutoSize disable auto size
  *
  * 
  * @cfg {Number} minColumnWidth default 50 pixels minimum column width 
@@ -9342,6 +9343,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     footerShow : true,
     headerShow : true,
     enableColumnResize: true,
+    disableAutoSize: false,
   
     rowSelection : false,
     cellSelection : false,
@@ -10507,6 +10509,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
      */
     autoSize : function()
     {
+        if(this.disableAutoSize) {
+            Roo.log("DISABLEAUTOSIZE");
+            return;
+        }
         //var ctr = Roo.get(this.container.dom.parentElement);
         var ctr = Roo.get(this.el.dom);
         
index 751bc13..934f0a3 100644 (file)
@@ -395,7 +395,7 @@ Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(
 this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;this.view=this;this.sm=this.sm||{xtype:'RowSelectionModel'};if(this.sm){this.sm.grid=this;this.selModel=Roo.factory(this.sm,Roo.grid);
 this.sm=this.selModel;this.sm.xmodule=this.xmodule||false;}if(this.cm&&typeof(this.cm.config)=='undefined'){this.colModel=new Roo.grid.ColumnModel(this.cm);this.cm=this.colModel;this.cm.xmodule=this.xmodule||false;}if(this.store){this.store=Roo.factory(this.store,Roo.data);
 this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.store){this.footer.dataSource=this.ds;this.footer=Roo.factory(this.footer);}this.addEvents({"cellclick":true,"celldblclick":true,"rowclick":true,"rowdblclick":true,"mouseover":true,"mouseout":true,'rowclass':true,'rowsrendered':true,"contextmenu":true,"rowcontextmenu":true,"cellcontextmenu":true,"headercontextmenu":true,"mousedown":true}
-);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,empty_results:'',striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,enableColumnResize:true,rowSelection:false,cellSelection:false,layout:false,minColumnWidth:50,bodyEl:false,headEl:false,resizeProxy:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,view:false,getAutoCreate:function(){var A=Roo.apply({}
+);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,empty_results:'',striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,enableColumnResize:true,disableAutoSize:false,rowSelection:false,cellSelection:false,layout:false,minColumnWidth:50,bodyEl:false,headEl:false,resizeProxy:false,container:false,lazyLoad:false,CSS:Roo.util.CSS,auto_hide_footer:false,view:false,getAutoCreate:function(){var A=Roo.apply({}
 ,Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table',cn:[]};if(this.scrollBody){A.cls+=' table-body-fixed';}if(this.striped){A.cls+=' table-striped';}if(this.hover){A.cls+=' table-hover';}if(this.bordered){A.cls+=' table-bordered';
 }if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}if(this.layout){A.style=(typeof(A.style)=='undefined')?('table-layout:'+this.layout+';'):(A.style+('table-layout:'+this.layout+';'));
 }if(this.store||this.cm){if(this.headerShow){A.cn.push(this.renderHeader());}A.cn.push(this.renderBody());if(this.footerShow){A.cn.push(this.renderFooter());}}return {cn:[A]};},initEvents:function(){if(!this.store||!this.cm){return;}if(this.selModel){this.selModel.initEvents();
@@ -444,9 +444,9 @@ return (typeof(D[B])=='undefined')?false:D[B];},renderRow:function(cm,ds,A){var
 if(typeof(C[A])=='undefined'){return;}C[A][B?'removeClass':'addClass']('d-none');},getSelectionModel:function(){if(!this.selModel){this.selModel=new Roo.bootstrap.Table.RowSelectionModel({grid:this});}return this.selModel;},renderCellObject:function(r){var A=this;
 r.cfg.parentId=(typeof(r.container)=='string')?r.container:r.container.id;var t=r.cfg.render(r.container);if(r.cfg.cn){Roo.each(r.cfg.cn,function(c){var B={container:t.getChildContainer(),cfg:c};A.renderCellObject(B);})}},getRowIndex:function(A){var B=-1;
 Roo.each(this.el.select('tbody > tr',true).elements,function(el,C){if(el!=A){return;}B=C;});return B;},getHeaderIndex:function(A){var B=this.headEl.select('th',true).elements;return B[A];},getCellIndex:function(A){var id=String(A.className).match(Roo.bootstrap.Table.cellRE);
-if(id){return parseInt(id[1],10);}return 0;},getGridEl:function(){return this.el;},autoSize:function(){var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();var D=this.getGridEl().select('tfoot',true).first();
-var cw=A.getWidth();this.getGridEl().select('tfoot tr, tfoot  td',true).setWidth(cw);if(C){C.setWidth(A.getWidth());var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tbody tr',true).setWidth(cw);this.initCSS();
-return;},onBodyScroll:function(){if(this.headEl){this.headEl.setStyle({'position':'relative','left':(-1*this.bodyEl.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.bodyEl.dom.scrollHeight;var B=Math.ceil(this.bodyEl.getScroll().top);var C=this.bodyEl.getHeight();
+if(id){return parseInt(id[1],10);}return 0;},getGridEl:function(){return this.el;},autoSize:function(){if(this.disableAutoSize){Roo.log("DISABLEAUTOSIZE");return;}var A=Roo.get(this.el.dom);var B=this.getGridEl().select('thead',true).first();var C=this.getGridEl().select('tbody',true).first();
+var D=this.getGridEl().select('tfoot',true).first();var cw=A.getWidth();this.getGridEl().select('tfoot tr, tfoot  td',true).setWidth(cw);if(C){C.setWidth(A.getWidth());var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tbody tr',true).setWidth(cw);
+this.initCSS();return;},onBodyScroll:function(){if(this.headEl){this.headEl.setStyle({'position':'relative','left':(-1*this.bodyEl.dom.scrollLeft)+'px'});}if(this.lazyLoad){var A=this.bodyEl.dom.scrollHeight;var B=Math.ceil(this.bodyEl.getScroll().top);var C=this.bodyEl.getHeight();
 if(A-C==B){var D=this.ds.getTotalCount();if(this.footer.cursor+this.footer.pageSize<D){this.footer.ds.load({params:{start:this.footer.cursor+this.footer.pageSize,limit:this.footer.pageSize},add:true});}}}},onColumnSplitterMoved:function(i,A){this.userResized=true;
 var cm=this.colModel;var w=this.getHeaderIndex(i).getWidth()+A;cm.setColumnWidth(i,w,true);this.initCSS();this.fireEvent("columnresize",i,w);},onHeaderChange:function(){var A=this.renderHeader();var B=this.el.select('table',true).first();this.headEl.remove();
 this.headEl=B.createChild(A,this.bodyEl,false);Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);if(this.enableColumnResize!==false&&Roo.grid.SplitDragZone){new Roo.grid.SplitDragZone(this,this.headEl.dom,false);