瀏覽代碼

HPCC-9650 Sorting fails when same column is clicked several times

WUQuery cannot sort on TotalThorTime

Fixes HPCC-9650

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 11 年之前
父節點
當前提交
06f6f0863e
共有 3 個文件被更改,包括 15 次插入7 次删除
  1. 5 4
      esp/files/scripts/ESPRequest.js
  2. 5 0
      esp/files/scripts/ESPWorkunit.js
  3. 5 3
      esp/files/scripts/LZBrowseWidget.js

+ 5 - 4
esp/files/scripts/ESPRequest.js

@@ -259,6 +259,9 @@ define([
         },
 
         Store: declare(null, {
+            SortbyProperty: 'Sortby',
+            DescendingProperty: 'Descending',
+
             constructor: function (options) {
                 if (!this.service) {
                     throw new Error("service:  Undefined - Missing service name (eg 'WsWorkunts').");
@@ -329,10 +332,8 @@ define([
                     }
                 }
                 if (options !== undefined && options.sort !== undefined && options.sort[0].attribute !== undefined) {
-                    request['Sortby'] = options.sort[0].attribute;
-                    if (options.sort[0].descending) {
-                        request['Descending'] = options.sort[0].descending;
-                    }
+                    request[this.SortbyProperty] = options.sort[0].attribute;
+                    request[this.DescendingProperty] = options.sort[0].descending ? true : false;
                 }
                 if (this.preRequest) {
                     this.preRequest(request);

+ 5 - 0
esp/files/scripts/ESPWorkunit.js

@@ -42,6 +42,11 @@ define([
         countProperty: "Count",
 
         _watched: [],
+        preRequest: function (request) {
+            if (request.Sortby && request.Sortby === "TotalThorTime") {
+                request.Sortby = "ThorTime";
+            }
+        },
         create: function (id) {
             return new Workunit({
                 Wuid: id

+ 5 - 3
esp/files/scripts/LZBrowseWidget.js

@@ -339,11 +339,13 @@ define([
                                 }
                             }
                             return false;
-                        }
+                        },
+                        sortable: false
                     }),
                     displayName: tree({
                         label: "Name",
                         collapseOnRefresh: true,
+                        sortable: false,
                         formatter: function (name, row) {
                             var img = "../files/img/";
                             if (row.isDir === undefined) {
@@ -356,8 +358,8 @@ define([
                             return "<img src='" + img + "'/>&nbsp;" + name;
                         }
                     }),
-                    filesize: { label: "Size", width: 108 },
-                    modifiedtime: { label: "Date", width: 180 }
+                    filesize: { label: "Size", width: 108, sortable: false },
+                    modifiedtime: { label: "Date", width: 180, sortable: false }
                 },
                 getSelected: function () {
                     var retVal = [];