From fbfab00d8c72f94e6b8f34b62c401fa4c5c08ab3 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 24 Jan 2019 15:10:46 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/Table.js --- roojs-bootstrap-debug.js | 6 ++++-- roojs-bootstrap.js | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index f08f314492..e4d6af456e 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -6808,8 +6808,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { c.html = '' + c.html; } + // could use BS4 hidden-..-down + if(typeof(config.lgHeader) != 'undefined'){ - hh += ''; + hh += ''; } if(typeof(config.mdHeader) != 'undefined'){ @@ -6874,7 +6876,7 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { } c.cls += ' col-' + size + '-' + config[size] + ( - size == 'xs' ? (' col-' + + config[size] ) : '' // bs4 col-{num} replaces col-xs + size == 'xs' ? (' col-' + config[size] ) : '' // bs4 col-{num} replaces col-xs ); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 5c5b94e10c..35bf463093 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -273,11 +273,11 @@ var F=E.dom.rowIndex-1;if(E!==false){this.fireEvent("row"+A,this,F,e);if(B!==fal 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);}},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('glyphicon-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';}if(typeof(C.mdHeader)!='undefined'){hh+=''; +;var hh='';if(typeof(C.sortable)!='undefined'&&C.sortable){c.cls='sortable';c.html=''+c.html;}if(typeof(C.lgHeader)!='undefined'){hh+='';}if(typeof(C.mdHeader)!='undefined'){hh+=''; }if(typeof(C.smHeader)!='undefined'){hh+='';}if(typeof(C.xsHeader)!='undefined'){hh+='';}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.hidden)!='undefined'&&C.hidden){c.style+=' display:none;';}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.width)!='undefined'){c.style+=' width:'+C.width+'px;';this.totalWidth+=C.width;}else{this.totalWidth+=100;}if(typeof(C.cls)!='undefined'){c.cls=(typeof(c.cls)=='undefined')?C.cls:(c.cls+' '+C.cls);}['xs','sm','md','lg'].map(function(D){if(typeof(C[D])=='undefined'){return; -}if(!C[D]){c.cls+=' hidden-'+D+' hidden'+D+'down';return;}c.cls+=' col-'+D+'-'+C[D]+(D=='xs'?(' col-'++C[D]):'');});A.cn.push(c)}return A;},renderBody:function(){var A={tag:'tbody',cn:[{tag:'tr',cn:[{tag:'td',colspan:this.cm.getColumnCount()}]}]};return A; +}if(!C[D]){c.cls+=' hidden-'+D+' hidden'+D+'down';return;}c.cls+=' col-'+D+'-'+C[D]+(D=='xs'?(' col-'+C[D]):'');});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(['glyphicon-arrow-up','glyphicon-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(['glyphicon-arrow-up']);}if(e.hasClass('sortable')&&e.attr('sort')==A.store.sortInfo.field&&A.store.sortInfo.direction.toUpperCase()=='DESC'){e.select('i',true).addClass(['glyphicon-arrow-down']); }}});var B=this.mainBody;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);}var C=this.el.select('tfoot',true).first(); -- 2.39.2