commit 3ea01e89d1d731369fd7ac98fb6e3efe7579d585
parent c5be07622f6e58a74b2904df8560a5fa06040033
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 25 Dec 2011 11:15:26 +0100
Bugfix: Don't cause trouble when the user cancels the edit
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/frontend/js/Components/Project/ProjectEditor.js b/src/frontend/js/Components/Project/ProjectEditor.js
@@ -82,11 +82,20 @@ Ext.define('PartKeepr.ProjectEditor', {
*/
onProjectGridEdit: function (editor, e) {
if (e.field == "part_id") {
+ /**
+ * If the user cancelled the editing, set the field to the original value
+ */
+ if (e.value === null) {
+ e.record.set("part_id", e.originalValue);
+ }
+
+ /**
+ * Inject the name into the record
+ */
var rec = e.column.getEditor().store.getById(e.value);
if (rec) {
e.record.set("part_name", rec.get("name"));
}
-
}
},
/**