roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Tue, 27 Jul 2021 03:37:17 +0000 (11:37 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 27 Jul 2021 03:37:17 +0000 (11:37 +0800)
roojs-bootstrap-debug.js

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

index 57f6f07..39cf93d 100644 (file)
@@ -9912,28 +9912,28 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component,  {
             if(typeof(config.cls) != 'undefined'){
                 td.cls = (typeof(td.cls) == 'undefined') ? config.cls : (td.cls + ' ' + config.cls);
             }
-            /*
-            ['xs','sm','md','lg'].map(function(size){
-                
-                if(typeof(config[size]) == 'undefined'){
-                    return;
-                }
-                
-                
-                  
-                if (!config[size]) { // 0 = hidden
-                    // BS 4 '0' is treated as hide that column and below.
-                    td.cls += ' hidden-' + size + ' hidden' + size + '-down';
-                    return;
-                }
-                
-                td.cls += ' col-' + size + '-' + config[size] + (
-                    size == 'xs' ? (' col-' +   config[size] ) : '' // bs4 col-{num} replaces col-xs
-                );
-                 
-
-            });
-            */
+            if (this.responsive) {
+                ['xs','sm','md','lg'].map(function(size){
+                    
+                    if(typeof(config[size]) == 'undefined'){
+                        return;
+                    }
+                    
+                    
+                      
+                    if (!config[size]) { // 0 = hidden
+                        // BS 4 '0' is treated as hide that column and below.
+                        td.cls += ' hidden-' + size + ' hidden' + size + '-down';
+                        return;
+                    }
+                    
+                    td.cls += ' col-' + size + '-' + config[size] + (
+                        size == 'xs' ? (' col-' +   config[size] ) : '' // bs4 col-{num} replaces col-xs
+                    );
+                     
+    
+                });
+            }
             row.cn.push(td);
            
         }
index 36daebf..a1b2ed0 100644 (file)
@@ -409,16 +409,16 @@ var E=parseInt(el.offsetLeft,10);var F=D+el.offsetHeight;var G=E+el.offsetWidth;
 return (typeof(D[B])=='undefined')?false:D[B];},renderRow:function(cm,ds,A){var d=ds.getAt(A);var B={tag:'tr',cls:'x-row-'+A,cn:[]};var C=[];for(var i=0,D=cm.getColumnCount();i<D;i++){var E=cm.config[i];var F=cm.getRenderer(i);var G='';var id=false;if(typeof(F)!=='undefined'){G=F(d.data[cm.getDataIndex(i)],false,d);
 }if(typeof(G)==='object'){id=Roo.id();C.push({container:id,cfg:G})}var H={record:d,rowIndex:A,colIndex:i,rowClass:''};this.fireEvent('rowclass',this,H);var td={tag:'td',cls:H.rowClass+' x-col-'+i,style:'',html:(typeof(G)==='object')?'':G};if(id){td.id=id;
 }if(typeof(E.colspan)!='undefined'){td.colspan=E.colspan;}if(typeof(E.align)!='undefined'&&E.align.length){td.style+=' text-align:'+E.align+';';}if(typeof(E.valign)!='undefined'&&E.valign.length){td.style+=' vertical-align:'+E.valign+';';}if(typeof(E.cursor)!='undefined'){td.style+=' cursor:'+E.cursor+';';
-}if(typeof(E.cls)!='undefined'){td.cls=(typeof(td.cls)=='undefined')?E.cls:(td.cls+' '+E.cls);}B.cn.push(td);}B.cellObjects=C;return B;},onBeforeLoad:function(){},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},setRowVisibility:function(A,B){var bt=this.bodyEl.dom;
-var C=this.el.select('tbody > tr',true).elements;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(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);
+}if(typeof(E.cls)!='undefined'){td.cls=(typeof(td.cls)=='undefined')?E.cls:(td.cls+' '+E.cls);}if(this.responsive){['xs','sm','md','lg'].map(function(I){if(typeof(E[I])=='undefined'){return;}if(!E[I]){td.cls+=' hidden-'+I+' hidden'+I+'-down';return;}td.cls+=' col-'+I+'-'+E[I]+(I=='xs'?(' col-'+E[I]):'');
+});}B.cn.push(td);}B.cellObjects=C;return B;},onBeforeLoad:function(){},clear:function(){this.el.select('tbody',true).first().dom.innerHTML='';},setRowVisibility:function(A,B){var bt=this.bodyEl.dom;var C=this.el.select('tbody > tr',true).elements;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(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);
 }},onHiddenChange:function(A,B,C){var D='#'+this.id+' .x-hcol-'+B;var E='#'+this.id+' .x-col-'+B;this.CSS.updateRule(D,"display","");this.CSS.updateRule(E,"display","");if(C){this.CSS.updateRule(D,"display","none");this.CSS.updateRule(E,"display","none");
 }this.onHeaderChange();this.onLoad();},setColumnWidth:function(A,B){if(!this.colModel.config[A]){return;}var w=B.split(" ");var C=this.el.dom.getElementsByClassName("x-col-"+A);var D=this.el.dom.getElementsByClassName("x-hcol-"+A);for(var j=0;j<w.length;j++){if(!w[j]){continue;
 }var E=w[j].split("-");if(!Number.isInteger(E[1]*1)){continue;}if(!this.colModel.config[A][E[0]]){continue;}if(!D[0].classList.contains("col-"+E[0]+"-"+this.colModel.config[A][E[0]])){continue;}D[0].classList.replace("col-"+E[0]+"-"+this.colModel.config[A][E[0]],"col-"+E[0]+"-"+E[1]);