Roo/bootstrap/layout/Border.js
authorAlan Knowles <alan@roojs.com>
Fri, 7 Jul 2017 05:08:51 +0000 (13:08 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 7 Jul 2017 05:08:51 +0000 (13:08 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/layout/Border.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 08ae3a7..02c5cd0 100644 (file)
@@ -344,6 +344,7 @@ layout.addxtype({
                 var el = this.el.createChild();
                 // create the grid first...
                 cfg.grid.container = el;
+                cfg.grid.scrollBody = true;
                 cfg.grid = new cfg.grid.xns[cfg.grid.xtype](cfg.grid);
                 
                 
index 225f513..e628080 100644 (file)
@@ -5661,6 +5661,7 @@ Roo.LoadMask.prototype = {
  * @cfg {Boolean} headerShow (true|false) generate thead, default true
  * @cfg {Boolean} rowSelection (true|false) default false
  * @cfg {Boolean} cellSelection (true|false) default false
+ * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header
  * @cfg {Roo.bootstrap.PagingToolbar} footer  a paging toolbar
  
  * 
@@ -5830,6 +5831,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     summary: false,
     width: false,
     striped : false,
+    scrollBody : false,
     bordered: false,
     hover:  false,
     condensed : false,
@@ -5858,10 +5860,12 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
         
         cfg = {
             tag: 'table',
-            cls : 'table table-body-fixed',
+            cls : 'table',
             cn : []
         };
-            
+        if (this.scrollBody) {
+            cfg.cls += ' table-body-fixed';
+        }    
         if (this.striped) {
             cfg.cls += ' table-striped';
         }
@@ -31542,6 +31546,7 @@ layout.addxtype({
                 var el = this.el.createChild();
                 // create the grid first...
                 cfg.grid.container = el;
+                cfg.grid.scrollBody = true;
                 cfg.grid = new cfg.grid.xns[cfg.grid.xtype](cfg.grid);
                 
                 
index 039a05e..9c32e48 100644 (file)
@@ -226,10 +226,10 @@ Roo.bootstrap.Table=function(A){Roo.bootstrap.Table.superclass.constructor.call(
 this.rowSelection=(typeof(A.RowSelection)!='undefined')?A.RowSelection:this.rowSelection;this.cellSelection=(typeof(A.CellSelection)!='undefined')?A.CellSelection:this.cellSelection;this.headerShow=(typeof(A.thead)!='undefined')?A.thead:this.headerShow;this.footerShow=(typeof(A.tfoot)!='undefined')?A.tfoot:this.footerShow;
 if(this.sm){this.selModel=Roo.factory(this.sm,Roo.bootstrap.Table);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}
-);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,border:false,cellpadding:false,cellspacing:false,frame:false,rules:false,sortable:false,summary:false,width:false,striped:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,rowSelection:false,cellSelection:false,layout:false,mainBody:false,mainHead:false,container:false,getAutoCreate:function(){var A=Roo.apply({}
-,Roo.bootstrap.Table.superclass.getAutoCreate.call(this));A={tag:'table',cls:'table table-body-fixed',cn:[]};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.align){A.align=this.align;}if(this.bgcolor){A.bgcolor=this.bgcolor;}if(this.border){A.border=this.border;}if(this.cellpadding){A.cellpadding=this.cellpadding;}if(this.cellspacing){A.cellspacing=this.cellspacing;
-}if(this.frame){A.frame=this.frame;}if(this.rules){A.rules=this.rules;}if(this.sortable){A.sortable=this.sortable;}if(this.summary){A.summary=this.summary;}if(this.width){A.width=this.width;}if(this.layout){A.style=(typeof(A.style)=='undefined')?('table-layout:'+this.layout+';'):(A.style+('table-layout:'+this.layout+';'));
+);};Roo.extend(Roo.bootstrap.Table,Roo.bootstrap.Component,{cls:false,align:false,bgcolor:false,border:false,cellpadding:false,cellspacing:false,frame:false,rules:false,sortable:false,summary:false,width:false,striped:false,scrollBody:false,bordered:false,hover:false,condensed:false,responsive:false,sm:false,cm:false,store:false,loadMask:false,footerShow:true,headerShow:true,rowSelection:false,cellSelection:false,layout:false,mainBody:false,mainHead:false,container: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.align){A.align=this.align;}if(this.bgcolor){A.bgcolor=this.bgcolor;}if(this.border){A.border=this.border;}if(this.cellpadding){A.cellpadding=this.cellpadding;
+}if(this.cellspacing){A.cellspacing=this.cellspacing;}if(this.frame){A.frame=this.frame;}if(this.rules){A.rules=this.rules;}if(this.sortable){A.sortable=this.sortable;}if(this.summary){A.summary=this.summary;}if(this.width){A.width=this.width;}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;}this.mainBody=this.el.select('tbody',true).first();
 this.mainHead=this.el.select('thead',true).first();var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.el.on("click",this.onClick,this);this.el.on("dblclick",this.onDblClick,this);if(this.footer){this.footer.parentId=this.id;
 this.footer.onRender(this.el.select('tfoot tr td').first(),null);}this.maskEl=new Roo.LoadMask(this.el,{store:this.ds,msgCls:'roo-el-mask-msg'});this.store.on('load',this.onLoad,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('update',this.onUpdate,this);
@@ -1322,11 +1322,11 @@ b.height=C-(m.top+m.bottom);var L=(b.width+m.left+m.right);b.x=w-L+m.left;b.y=D+
 },findPanel:function(A){var rs=this.regions;for(var B in rs){if(typeof rs[B]!="function"){var p=rs[B].getPanel(A);if(p){return p;}}}return null;},showPanel:function(A){var rs=this.regions;for(var B in rs){var r=rs[B];if(typeof r!="function"){if(r.hasPanel(A)){return r.showPanel(A);
 }}}return null;},addxtype:function(A){var B=false;if(typeof(A.region)=='undefined'){Roo.log("Failed to add Panel, region was not set");Roo.log(A);return false;}var C=A.region;delete A.region;var D=[];if(A.items){D=A.items;delete A.items;}var nb=false;switch(A.xtype){case 'Content':case 'Scroll':case 'View':A.autoCreate=true;
 B=new A.xns[A.xtype](A);this.add(C,B);break;case 'Nest':var E=A.layout;E.el=this.el.createChild();E.items=E.items||[];delete A.layout;D=E.items;if(C=='center'&&this.active&&this.getRegion('center').panels.length<1){A.background=false;}A.layout=new Roo.bootstrap.layout.Border(E);
-B=new A.xns[A.xtype](A);this.add(C,B);nb={};break;case 'Grid':var el=this.el.createChild();A.grid.container=el;A.grid=new A.grid.xns[A.grid.xtype](A.grid);if(C=='center'&&this.active){A.background=false;}B=new A.xns[A.xtype](A);this.add(C,B);if(A.background){B.on('activate',function(gp){if(!gp.grid.rendered){gp.grid.render(gp.grid.getGridEl());
-}});}else{A.grid.render(A.grid.getGridEl());}break;case 'Border':B=this;break;default:Roo.log(A);throw "Can not add '"+A.xtype+"' to Border";return null;}this.beginUpdate();var C='';var F={};Roo.each(D,function(i){C=nb&&i.region?i.region:false;var G=B.addxtype(i);
-if(C){nb[C]=nb[C]==undefined?0:nb[C]+1;if(!i.background){F[C]=nb[C];}}});this.endUpdate();if(nb){for(var r in F){C=this.getRegion(r);if(C){C.showPanel(F[r]);}}}return B;},factory:function(A){var B=Roo.bootstrap.layout.Border.regions;var C=A.region;A.mgr=this;
-var r=Roo.bootstrap.layout;Roo.log(C);switch(C){case "north":return new r.North(A);case "south":return new r.South(A);case "east":return new r.East(A);case "west":return new r.West(A);case "center":return new r.Center(A);}throw 'Layout region "'+C+'" not supported.';
-}});
+B=new A.xns[A.xtype](A);this.add(C,B);nb={};break;case 'Grid':var el=this.el.createChild();A.grid.container=el;A.grid.scrollBody=true;A.grid=new A.grid.xns[A.grid.xtype](A.grid);if(C=='center'&&this.active){A.background=false;}B=new A.xns[A.xtype](A);this.add(C,B);
+if(A.background){B.on('activate',function(gp){if(!gp.grid.rendered){gp.grid.render(gp.grid.getGridEl());}});}else{A.grid.render(A.grid.getGridEl());}break;case 'Border':B=this;break;default:Roo.log(A);throw "Can not add '"+A.xtype+"' to Border";return null;
+}this.beginUpdate();var C='';var F={};Roo.each(D,function(i){C=nb&&i.region?i.region:false;var G=B.addxtype(i);if(C){nb[C]=nb[C]==undefined?0:nb[C]+1;if(!i.background){F[C]=nb[C];}}});this.endUpdate();if(nb){for(var r in F){C=this.getRegion(r);if(C){C.showPanel(F[r]);
+}}}return B;},factory:function(A){var B=Roo.bootstrap.layout.Border.regions;var C=A.region;A.mgr=this;var r=Roo.bootstrap.layout;Roo.log(C);switch(C){case "north":return new r.North(A);case "south":return new r.South(A);case "east":return new r.East(A);case "west":return new r.West(A);
+case "center":return new r.Center(A);}throw 'Layout region "'+C+'" not supported.';}});
 // Roo/bootstrap/layout/Basic.js
 Roo.bootstrap.layout.Basic=function(A){this.mgr=A.mgr;this.position=A.region;var B=A.skipConfig;this.events={"beforeremove":true,"invalidated":true,"visibilitychange":true,"paneladded":true,"panelremoved":true,"beforecollapse":true,"collapsed":true,"expanded":true,"slideshow":true,"slidehide":true,"panelactivated":true,"resized":true}
 ;this.panels=new Roo.util.MixedCollection();this.panels.getKey=this.getPanelId.createDelegate(this);this.box=null;this.activePanel=null;if(A.listeners||A.events){Roo.bootstrap.layout.Basic.superclass.constructor.call(this,{listeners:A.listeners||{},events:A.events||{}