Author: orudyy
Date: Mon Jul 18 16:59:09 2016
New Revision: 1753270
URL: http://svn.apache.org/viewvc?rev=1753270&view=rev
Log:
QPID-7248: Emit rowBrowsed event from QueryGrid on clicking through the row and
use event handlers to navigate to tabs
Modified:
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryGrid.js
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
Modified:
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js?rev=1753270&r1=1753269&r2=1753270&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
(original)
+++
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/VirtualHost.js
Mon Jul 18 16:59:09 2016
@@ -351,7 +351,6 @@ define(["dojo/parser",
rowsPerPage: 10,
transformer: lang.hitch(this, this._transformConnectionData),
management: this.management,
- controller: controller,
parentObject: this.modelObj,
category: "Connection",
selectClause: "id, name, principal, port.name AS port,
transport, sessionCount, messagesIn, bytesIn, messagesOut, bytesOut",
@@ -386,6 +385,7 @@ define(["dojo/parser",
}
]
}, findNode("connections"));
+ this.connectionsGrid.on('rowBrowsed',
function(event){controller.showById(event.id);});
that.connectionsGrid.startup();
// Add onShow handler to work around an issue with not rendering
of grid columns before first update.
Modified:
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js?rev=1753270&r1=1753269&r2=1753270&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
(original)
+++
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/controller.js
Mon Jul 18 16:59:09 2016
@@ -231,5 +231,14 @@ define(["dojo/dom",
tabObject.tabId = newTabId;
};
+ controller.showById = function(id)
+ {
+ var item = this.structure.findById(id);
+ if (item != null)
+ {
+ this.show(item.type, item.name, item.parent, item.id);
+ }
+ };
+
return controller;
});
Modified:
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryGrid.js
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryGrid.js?rev=1753270&r1=1753269&r2=1753270&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryGrid.js
(original)
+++
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryGrid.js
Mon Jul 18 16:59:09 2016
@@ -55,8 +55,6 @@ define(["dojo/_base/declare",
return declare("qpid.management.query.QueryGrid",
[Grid, Keyboard, Selection, Pagination, DijitRegistry,
ColumnResizer],
{
- management: null,
- controller: null,
detectChanges: false,
highlightUpdatedRows : false,
_store: null,
@@ -97,12 +95,12 @@ define(["dojo/_base/declare",
postCreate: function ()
{
this.inherited(arguments);
- this.on('.dgrid-row:dblclick', lang.hitch(this,
this._openObjectTab));
+ this.on('.dgrid-row:dblclick', lang.hitch(this,
this._rowBrowsed));
this.on('.dgrid-row:keypress', lang.hitch(this, function
(event)
{
if (event.keyCode === keys.ENTER)
{
- this._openObjectTab(event);
+ this._rowBrowsed(event);
}
}));
@@ -214,18 +212,13 @@ define(["dojo/_base/declare",
this._store.orderBy = orderByExpression;
on.emit(this.domNode, "orderByChanged", {orderBy:
orderByExpression});
},
- _openObjectTab: function (event)
+ _rowBrowsed: function (event)
{
var row = this.row(event);
- var item = this.controller.structure.findById(row.id,
null, "broker");
- if (item != null)
- {
- this.controller.show(item.type, item.name,
item.parent, item.id);
- }
+ on.emit(this.domNode, "rowBrowsed", {id: row.id});
},
_onFetchCompleted: function (event)
{
- var rowsPerPage = this.rowsPerPage;
if ( event.totalLength > 0 && event.results.length == 0)
{
this.gotoPage(Math.min(this._currentPage,
Math.ceil(event.totalLength / this.rowsPerPage)) || 1);
Modified:
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js?rev=1753270&r1=1753269&r2=1753270&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
(original)
+++
qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/js/qpid/management/query/QueryWidget.js
Mon Jul 18 16:59:09 2016
@@ -632,7 +632,6 @@ define(["dojo/_base/declare",
}
});
var grid = new Grid({
- controller: this.controller,
management: this.management,
category: this.categoryName.toLowerCase(),
parentObject: this.parentObject,
@@ -674,6 +673,7 @@ define(["dojo/_base/declare",
grid.on('dgrid-columnreorder', lang.hitch(this,
this._standardModeColumnOrderChanged));
grid.on('dgrid-columnstatechange', lang.hitch(this,
this._standardModeColumnStateChanged));
grid.hiderToggleNode.title = "Remove columns";
+ grid.on('rowBrowsed', lang.hitch(this,
function(event){this.controller.showById(event.id);}));
this._resultsGrid = grid;
},
_queryCompleted: function (e)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]