partkeepr

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

commit 1d2bf30ff13ac945c9d3db033fd1012671b60fca
parent 595529d60fc1a4977cb436ffd06370ea14485ba0
Author: Felicitus <felicitus@felicitus.org>
Date:   Wed,  4 Jan 2012 18:46:29 +0100

Focus the first field in the part editor window when it has been opened

Diffstat:
Msrc/frontend/js/Components/Part/Editor/PartEditor.js | 16++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/frontend/js/Components/Part/Editor/PartEditor.js b/src/frontend/js/Components/Part/Editor/PartEditor.js @@ -19,13 +19,16 @@ Ext.define('PartKeepr.PartEditor', { */ initComponent: function () { + this.nameField = Ext.create("Ext.form.field.Text", { + name: 'name', + fieldLabel: i18n("Name"), + allowBlank: false, + labelWidth: 150 + }); + // Defines the basic editor fields - var basicEditorFields = [{ - xtype: 'textfield', - name: 'name', - fieldLabel: i18n("Name"), - allowBlank: false - }, + var basicEditorFields = [ + this.nameField, { layout: 'column', bodyStyle: 'background:#DBDBDB', @@ -189,6 +192,7 @@ Ext.define('PartKeepr.PartEditor', { }, onEditStart: function () { this.bindChildStores(); + this.nameField.focus(); }, _onItemSaved: function () { this.fireEvent("partSaved", this.record);