From 1409d975a8df51092fc50637c6c611190a631b7d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Dec 2020 11:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DCMS=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=8F=AF=E8=83=BD=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../x_component_cms_Module/ListExplorer.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/o2web/source/x_component_cms_Module/ListExplorer.js b/o2web/source/x_component_cms_Module/ListExplorer.js index a1c09c5006..b30ad16fb2 100644 --- a/o2web/source/x_component_cms_Module/ListExplorer.js +++ b/o2web/source/x_component_cms_Module/ListExplorer.js @@ -345,6 +345,7 @@ MWF.xApplication.cms.Module.ListExplorer.DefaultList = new Class({ this.loadElementList(); }, resort : function(th){ + debugger; this.orderField = th.retrieve("field"); var orderType = th.retrieve("orderType"); //th.eliminate(orderType); @@ -757,16 +758,20 @@ MWF.xApplication.cms.Module.ListExplorer.List = new Class({ }.bind(this)); }, resort : function(th){ + debugger; this.orderField = th.retrieve("field"); this.orderType = ( th.retrieve("orderType") || "" ).toLowerCase(); - //th.eliminate(orderType); - if( this.orderType == "" ){ - this.orderType = "asc"; - }else if( this.orderType == "asc" ){ - this.orderType = "desc"; + if( this.orderField === this.data.orderField ){ + this.orderType = this.orderType === "asc" ? "desc" : "asc"; }else{ - this.orderField = this.data.orderField ? this.data.orderField : ""; - this.orderType = this.data.orderType ? this.data.orderType : ""; + if( this.orderType == "" ){ + this.orderType = "asc"; + }else if( this.orderType == "asc" ){ + this.orderType = "desc"; + }else{ + this.orderField = this.data.orderField ? this.data.orderField : ""; + this.orderType = this.data.orderType ? this.data.orderType : ""; + } } this.reload(); }, -- GitLab