You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2016/04/17 22:29:47 UTC

svn commit: r1739647 - in /qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query: DropDownSelect.js QueryBuilder.js

Author: orudyy
Date: Sun Apr 17 20:29:47 2016
New Revision: 1739647

URL: http://svn.apache.org/viewvc?rev=1739647&view=rev
Log:
QPID-7204: Add column resizing ability into query result grid; add sorting into drop down selector

Modified:
    qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/DropDownSelect.js
    qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryBuilder.js

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/DropDownSelect.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/DropDownSelect.js?rev=1739647&r1=1739646&r2=1739647&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/DropDownSelect.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/DropDownSelect.js Sun Apr 17 20:29:47 2016
@@ -118,6 +118,7 @@ function(declare, lang, array, json, dom
                         * widget inner fields
                         */
                        _optionsGrid: null,
+                       _descending: false,
 
                        postCreate:  function()
                                     {
@@ -156,7 +157,6 @@ function(declare, lang, array, json, dom
                                                                  collection: this.store,
                                                                  selectionMode: 'multiple',
                                                                  cellNavigation: true,
-                                                                 sort: this.nameProperty,
                                                                  allowSelectAll: true,
                                                                  minRowsPerPage : this.items ? this.items.length : 100,
                                                                  deselectOnRefresh: false
@@ -164,6 +164,7 @@ function(declare, lang, array, json, dom
                                                                this.optionsGrid);
                                       grid.on('dgrid-select', lang.hitch(this, this._selectionChanged));
                                       grid.on('dgrid-deselect', lang.hitch(this, this._selectionChanged));
+                                      grid.on('dgrid-sort', lang.hitch(this, function(event){this._descending = event.sort[0].descending}));
                                       grid.setTotal(this.items ? this.items.length : 0);
                                       this._optionsGrid =  grid;
                                    },
@@ -195,6 +196,7 @@ function(declare, lang, array, json, dom
                                         this.store = store;
                                         this._optionsGrid.set("columns", this._getOptionColumns());
                                         this._optionsGrid.set("minRowsPerPage", data.items?data.items.length:100);
+                                        this._optionsGrid.set("sort", [{property:this.nameProperty,descending:this._descending}]);
                                         this._applyFilter();
                                         this._optionsGrid.setTotal(this.items ? this.items.length : 0);
                                       }

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryBuilder.js
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryBuilder.js?rev=1739647&r1=1739646&r2=1739647&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryBuilder.js (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryBuilder.js Sun Apr 17 20:29:47 2016
@@ -30,6 +30,7 @@ define(["dojo/_base/declare",
         "dgrid/Selection",
         "dgrid/extensions/Pagination",
         "dgrid/Selector",
+        "dgrid/extensions/ColumnResizer",
         "dstore/Memory",
         'dstore/legacy/DstoreAdapter',
         "qpid/management/query/DropDownSelect",
@@ -68,6 +69,7 @@ define(["dojo/_base/declare",
                  Selection,
                  Pagination,
                  Selector,
+                 ColumnResizer,
                  Memory,
                  DstoreAdapter,
                  DropDownSelect,
@@ -307,14 +309,15 @@ define(["dojo/_base/declare",
                                              },
                                 _buildGrid:  function(store, select)
                                              {
-                                                var CustomGrid = declare([ Grid, Keyboard, Selection, Pagination ]);
+                                                var CustomGrid = declare([ Grid, Keyboard, Selection, Pagination, ColumnResizer ]);
                                                 var grid = new CustomGrid({
                                                                               columns: this._getColumns(select),
                                                                               collection: store,
                                                                               rowsPerPage: 100,
                                                                               selectionMode: 'single',
                                                                               cellNavigation: false,
-                                                                              className: 'dgrid-autoheight'
+                                                                              className: 'dgrid-autoheight',
+                                                                              adjustLastColumn: true
                                                                           },
                                                                           this.queryResultGrid);
                                                 this._resultsGrid = grid;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org