diff --git a/backend/static/main-hub/app/view/requests/RequestWindow.js b/backend/static/main-hub/app/view/requests/RequestWindow.js index 91cbe27dd..3929d0119 100644 --- a/backend/static/main-hub/app/view/requests/RequestWindow.js +++ b/backend/static/main-hub/app/view/requests/RequestWindow.js @@ -13,6 +13,10 @@ Ext.define("MainHub.view.requests.RequestWindow", { modal: true, resizable: true, + listeners: { + beforeclose: "onRequestWindowBeforeClose" + }, + items: [ { xtype: "container", diff --git a/backend/static/main-hub/app/view/requests/RequestWindowController.js b/backend/static/main-hub/app/view/requests/RequestWindowController.js index 0479b6a48..8419fdd80 100644 --- a/backend/static/main-hub/app/view/requests/RequestWindowController.js +++ b/backend/static/main-hub/app/view/requests/RequestWindowController.js @@ -393,6 +393,17 @@ Ext.define("MainHub.view.requests.RequestWindowController", { }); }, + onRequestWindowBeforeClose: function (wnd) { + var librariesInRequestStore = Ext.getStore("librariesInRequestStore"); + if (librariesInRequestStore) { + librariesInRequestStore.removeAll(); + } + var librariesInRequestGrid = wnd.down("#libraries-in-request-grid"); + if (librariesInRequestGrid) { + librariesInRequestGrid.getView().refresh(); + } + }, + initializeTooltips: function () { $.each($(".request-field-tooltip"), function (idx, item) { Ext.create("Ext.tip.ToolTip", {