소스 검색

Merge pull request #9767 from miguelvazq/HPCC-16904

HPCC-16904 Sorting in users/groups does not work

Reviewed-By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 년 전
부모
커밋
6b72d1cd06
2개의 변경된 파일21개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 2
      esp/src/eclwatch/UserQueryWidget.js
  2. 15 2
      esp/src/eclwatch/ws_access.js

+ 6 - 2
esp/src/eclwatch/UserQueryWidget.js

@@ -607,20 +607,24 @@ define([
                     username: {
                         width: 180,
                         label: this.i18n.Username,
+                        sortable: true,
                         formatter: function (_name, idx) {
                             return "<a href='#' class='dgrid-row-url'>" + _name + "</a>"
                         }
                     },
                     employeeID: {
                         width: 180,
+                        sortable: true,
                         label: this.i18n.EmployeeID
                     },
                     fullname: {
-                        label: this.i18n.FullName
+                        label: this.i18n.FullName,
+                        sortable: true
                     },
                     passwordexpiration: {
                         width: 180,
-                        label: this.i18n.PasswordExpiration
+                        label: this.i18n.PasswordExpiration,
+                        sortable: true
                     }
                 }
             }, this.id + "UsersGrid");

+ 15 - 2
esp/src/eclwatch/ws_access.js

@@ -38,7 +38,8 @@ define([
         responseTotalQualifier: "UserQueryResponse.TotalUsers",
         idProperty: "username",
         startProperty: "PageStartFrom",
-        countProperty: "PageSize"
+        countProperty: "PageSize",
+        SortbyProperty: 'SortBy'
     });
 
     var GroupsStore = declare([ESPRequest.Store], {
@@ -48,7 +49,19 @@ define([
         responseTotalQualifier: "GroupQueryResponse.TotalGroups",
         idProperty: "name",
         startProperty: "PageStartFrom",
-        countProperty: "PageSize"
+        countProperty: "PageSize",
+        SortbyProperty: 'SortBy',
+
+        preRequest: function (request) {
+            switch (request.SortBy) {
+                case "name":
+                    request.SortBy = "Name";
+                    break;
+                case "groupOwner":
+                    request.SortBy = "ManagedBy";
+                    break;
+            }
+        }
     });
 
     var CONCAT_SYMBOL = ":";