partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 29e78429b3aa7584a4c5df5898de419324e3e7d8
parent dc76b61c369014a3c60b0e80183df3c018f4dfd5
Author: Felicitus <felicitus@felicitus.org>
Date:   Sun, 10 Jul 2011 05:19:42 +0200

Added double click for part rows to open the editor

Diffstat:
Mfrontend/js/Components/Part/PartsGrid.js | 12++++++++++++
Mfrontend/js/Components/Part/PartsManager.js | 1+
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/frontend/js/Components/Part/PartsGrid.js b/frontend/js/Components/Part/PartsGrid.js @@ -38,11 +38,23 @@ Ext.define('PartKeepr.PartsGrid', { this.features = [groupingFeature]; + this.on("itemdblclick", this.onDoubleClick, this); + + this.addEvents("editPart"); + // Initialize the panel this.callParent(); }, /** + * Called when the record was double-clicked + */ + onDoubleClick: function (view, record) { + if (record) { + this.fireEvent("editPart", record.get("id")); + } + }, + /** * Defines the columns used in this grid. */ defineColumns: function () { diff --git a/frontend/js/Components/Part/PartsManager.js b/frontend/js/Components/Part/PartsManager.js @@ -49,6 +49,7 @@ Ext.define('PartKeepr.PartManager', { // Create the grid this.grid = Ext.create("PartKeepr.PartsGrid", { title: i18n("Parts List"), region: 'center', layout: 'fit', store: this.getStore()}); + this.grid.on("editPart", this.onEditPart, this); // Create the grid listeners this.grid.on("itemSelect", this.onItemSelect, this);