roojs-bootstrap.js
authoredward <edward@roojs.com>
Tue, 29 May 2018 08:51:18 +0000 (16:51 +0800)
committeredward <edward@roojs.com>
Tue, 29 May 2018 08:51:18 +0000 (16:51 +0800)
roojs-bootstrap-debug.js

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

index d778595..7d812b1 100644 (file)
@@ -6862,10 +6862,12 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
     onBodyScroll: function()
     {
         //Roo.log("body scrolled');" + this.mainBody.dom.scrollLeft);
-        this.mainHead.setStyle({
-            'position' : 'relative',
-            'left': (-1* this.mainBody.dom.scrollLeft) + 'px'
-        });
+        if(this.mainHead){
+            this.mainHead.setStyle({
+                'position' : 'relative',
+                'left': (-1* this.mainBody.dom.scrollLeft) + 'px'
+            });
+        }
         
         if(this.lazyLoad){
             
index 941c172..eeddb0e 100644 (file)
@@ -269,8 +269,8 @@ B.cellObjects=C;return B;},onBeforeLoad:function(){},clear:function(){this.el.se
 }C[A].dom.style.display=B?'':'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;},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();if(C){C.setSize(A.getWidth(),A.getHeight()-((B?B.getHeight():0)+(D?D.getHeight():0)));var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tr',true).setWidth(cw);return;},onBodyScroll:function(){this.mainHead.setStyle({'position':'relative','left':(-1*this.mainBody.dom.scrollLeft)+'px'}
-);if(this.lazyLoad){var A=this.mainBody.dom.scrollHeight;var B=Math.ceil(this.mainBody.getScroll().top);var C=this.mainBody.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}
+var cw=A.getWidth();if(C){C.setSize(A.getWidth(),A.getHeight()-((B?B.getHeight():0)+(D?D.getHeight():0)));var E=(C.dom.offsetWidth-C.dom.clientWidth);cw-=E;}cw=Math.max(cw,this.totalWidth);this.getGridEl().select('tr',true).setWidth(cw);return;},onBodyScroll:function(){if(this.mainHead){this.mainHead.setStyle({'position':'relative','left':(-1*this.mainBody.dom.scrollLeft)+'px'}
+);}if(this.lazyLoad){var A=this.mainBody.dom.scrollHeight;var B=Math.ceil(this.mainBody.getScroll().top);var C=this.mainBody.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});}}}},onHeaderChange:function(){this.updateHeaders.apply(this,arguments);},updateHeaders:function(){var A=this.renderHeader();var B=this.el.select('table',true).first();this.mainHead.remove();this.mainHead=B.createChild(A,this.mainBody,false);}
 });
 // Roo/bootstrap/TableCell.js