commit 581651316d4ad4233626c2f1639b3bcd57ab6c0b
parent 8f4bb660078083c4b9d204b871bb8cb329ffb762
Author: Felicitus <privat@timohummel.com>
Date: Mon, 23 May 2011 20:49:42 +0200
Adjusted default and minimum window sizes, keep storage location value when adding parts, added window hide action
Diffstat:
2 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/frontend/js/de.RaumZeitLabor.PartDB2/PartsManager/PartsManagerAddPartDialog.js b/frontend/js/de.RaumZeitLabor.PartDB2/PartsManager/PartsManagerAddPartDialog.js
@@ -3,11 +3,13 @@ Ext.ns("de.RaumZeitLabor.PartDB2.PartsManagerAddPartDialog");
de.RaumZeitLabor.PartDB2.PartsManagerAddPartDialog = Ext.extend(Ext.Window, {
closeAction: 'hide',
title: "Bauteil erfassen",
- width: 400,
+ width: 600,
+ minWidth: 600,
+ minHeight: 400,
border: false,
layout: 'fit',
frame: true,
- height: 300,
+ height: 400,
initComponent: function () {
this.addPartForm = new de.RaumZeitLabor.PartDB2.PartsManagerAddPartForm();
@@ -21,6 +23,10 @@ de.RaumZeitLabor.PartDB2.PartsManagerAddPartDialog = Ext.extend(Ext.Window, {
this.addPartForm.partName.focus(false, 300);
}.createDelegate(this));
+ this.addPartForm.on("cancelEntry", function () {
+ this.hide();
+ }.createDelegate(this));
+
de.RaumZeitLabor.PartDB2.PartsManagerAddPartDialog.superclass.initComponent.call(this);
}
});
diff --git a/frontend/js/de.RaumZeitLabor.PartDB2/PartsManager/PartsManagerAddPartForm.js b/frontend/js/de.RaumZeitLabor.PartDB2/PartsManager/PartsManagerAddPartForm.js
@@ -114,6 +114,11 @@ de.RaumZeitLabor.PartDB2.PartsManagerAddPartForm = Ext.extend(Ext.form.FormPanel
valueField: "id",
fieldLabel: "Footprint"
});
+
+ this.keepStorageLocation = new Ext.form.Checkbox({
+ boxLabel: "Lagerort nach dem Speichern beibehalten"
+ });
+
this.items = [
this.categoryComboBox,
@@ -132,6 +137,7 @@ de.RaumZeitLabor.PartDB2.PartsManagerAddPartForm = Ext.extend(Ext.form.FormPanel
]
},
this.partStorageLocation,
+ this.keepStorageLocation,
this.footprintCombo,
this.commentField
];
@@ -150,12 +156,18 @@ de.RaumZeitLabor.PartDB2.PartsManagerAddPartForm = Ext.extend(Ext.form.FormPanel
});
this.cancelButton = new Ext.Button({
- text: "Abbrechen"
+ text: "Abbrechen",
+ handler: this.onCancelAction.createDelegate(this)
});
+
+
this.buttons = [
this.addButton,
- this.cancelButton
+ this.cancelButton,
+
];
+
+ this.addEvents("cancelEntry");
de.RaumZeitLabor.PartDB2.PartsManagerAddPartForm.superclass.initComponent.call(this);
},
isStoreLocationInList: function () {
@@ -205,10 +217,32 @@ de.RaumZeitLabor.PartDB2.PartsManagerAddPartForm = Ext.extend(Ext.form.FormPanel
call.setParameter("footprint", this.footprintCombo.getValue());
call.setParameter("comment", this.commentField.getValue());
- //call.setHandler(this.onCategoriesLoaded.createDelegate(this))
+ call.setHandler(this.onPartAdded.createDelegate(this))
call.doCall();
}
},
+ onPartAdded: function () {
+ this.clearForm();
+ },
+ onCancelAction: function () {
+ this.clearForm(true);
+
+ this.fireEvent("cancelEntry");
+ },
+ clearForm: function (force) {
+ this.partName.reset();
+ this.partQuantity.reset();
+ this.partMinStock.reset();
+ this.footprintCombo.reset();
+ this.commentField.reset();
+
+ if (this.keepStorageLocation.getValue() !== true || force == true)
+ {
+ this.partStorageLocation.reset();
+ }
+
+ this.partName.focus(false, 10);
+ },
reloadStorageLocations: function () {
this.storageLocationStore.reload();
this.footprintStore.reload();