commit 7e5ee6f0a9084a34315fce978c40def5eb18a4de
parent 53ce1d3bf6e8cb88bba0d70bdf494eece31b14dc
Author: Felicitus <felicitus@felicitus.org>
Date: Wed, 4 Jan 2012 23:12:11 +0100
Work around a server-side exception if the category still contains parts. Unfortunately, ExtJS removes the node immediately. If an exception is thrown on the server-side, we simply reload the tree now. Fixes #123
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/frontend/js/Components/CategoryEditor/CategoryEditorTree.js b/src/frontend/js/Components/CategoryEditor/CategoryEditorTree.js
@@ -196,7 +196,13 @@ Ext.define("PartKeepr.CategoryEditorTree", {
onCategoryDelete: function (btn) {
if (btn == "yes") {
var del = this.getStore().getRootNode().findChild("id", this.menu.record.get("id"), true);
- del.destroy();
+ del.destroy({
+ failure: function () {
+ console.log("FOO");
+ this.loadCategories();
+ },
+ scope: this
+ });
}
}
});
\ No newline at end of file