From 95e252dd75283833736f7d8f2a151c7de65e7880 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 9 Jul 2021 14:32:31 +0800 Subject: [PATCH] sync --- Roo/bootstrap/Table.js | 5 ++--- docs/src/Roo_bootstrap_Table.js.html | 4 ++-- roojs-bootstrap-debug.js | 5 ++--- roojs-bootstrap.js | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Roo/bootstrap/Table.js b/Roo/bootstrap/Table.js index 27157466cf..fc5630dabc 100644 --- a/Roo/bootstrap/Table.js +++ b/Roo/bootstrap/Table.js @@ -320,11 +320,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { - var _this = this; Roo.each(this.el.select('thead th.sortable', true).elements, function(e){ - e.on('click', _this.sort, _this); - }); + e.on('click', this.sort, this); + }, this); this.mainBody.on("click", this.onClick, this); this.mainBody.on("dblclick", this.onDblClick, this); diff --git a/docs/src/Roo_bootstrap_Table.js.html b/docs/src/Roo_bootstrap_Table.js.html index 5f151cee5b..e20d7f4be0 100644 --- a/docs/src/Roo_bootstrap_Table.js.html +++ b/docs/src/Roo_bootstrap_Table.js.html @@ -1160,8 +1160,8 @@ this.mainHead = table.createChild(header, this.mainBody, false); Roo.each(this.el.select('thead th.sortable', true).elements, function(e){ - e.on('click', _this.sort, _this); - }); + e.on('click', this.sort, this); + }, this); }, diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 86b975f99d..a26bb7afc4 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -8270,11 +8270,10 @@ Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, { - var _this = this; Roo.each(this.el.select('thead th.sortable', true).elements, function(e){ - e.on('click', _this.sort, _this); - }); + e.on('click', this.sort, this); + }, this); this.mainBody.on("click", this.onClick, this); this.mainBody.on("dblclick", this.onDblClick, this); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index e95ecba04a..7a4594f34a 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -335,7 +335,7 @@ this.ds=this.store;this.ds.xmodule=this.xmodule||false;}if(this.footer&&this.sto }if(this.condensed){A.cls+=' table-condensed';}if(this.responsive){A.cls+=' table-responsive';}if(this.cls){A.cls+=' '+this.cls;}var _t=this;var cp=['align','bgcolor','border','cellpadding','cellspacing','frame','rules','sortable','summary','width'].forEach(function(k){if(_t[k]){A[k]=_t[k]; }});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();}this.mainBody=this.el.select('tbody',true).first();this.mainHead=this.el.select('thead',true).first();this.mainFoot=this.el.select('tfoot',true).first(); -var A=this;Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',A.sort,A);});this.mainBody.on("click",this.onClick,this);this.mainBody.on("dblclick",this.onDblClick,this);if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null); +Roo.each(this.el.select('thead th.sortable',true).elements,function(e){e.on('click',this.sort,this);},this);this.mainBody.on("click",this.onClick,this);this.mainBody.on("dblclick",this.onDblClick,this);if(this.footer){this.footer.parentId=this.id;this.footer.onRender(this.el.select('tfoot tr td').first(),null); if(this.lazyLoad){this.el.select('tfoot tr td').first().addClass('hide');}}if(this.loadMask){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);this.store.on('add',this.onAdd,this);this.store.on("clear",this.clear,this);this.el.on("contextmenu",this.onContextMenu,this);this.mainBody.on('scroll',this.onBodyScroll,this);this.cm.on("headerchange",this.onHeaderChange,this); this.cm.on("hiddenchange",this.onHiddenChange,this,arguments);},onContextMenu:function(e,t){this.processEvent("contextmenu",e);},processEvent:function(A,e){if(A!='touchstart'){this.fireEvent(A,e);}var t=e.getTarget();var B=Roo.get(t);if(!B){return;}if(B.findParent('tfoot',false,true)){return; -- 2.39.2