srkngrt
27 Nov 2011, 12:11 AM
Hello community,
I'm trying to explore the example Desktop. I wanted to add a msg box to ask the user if they are sure to close for example the window notepad or not. My first idea was to add the code in the notepad.js
I've put it between layout and items:
...
// IE has a bug where it will keep the iframe's background visible when the window
// is set to visibility:hidden. Hiding the window via position offsets instead gets
// around this bug.
hideMode: 'offsets',
layout: 'fit',
beforeDestroy: function() {
alert('Hehe');
},
items: [{
xtype: 'htmleditor',
id: 'notepad-editor',
value: [...
When I close the Notepad window in the desktop it will close and after it is closed my alert popup is shown. I get the same result when I work with adding listeners.
Then I tried to move this to the /js/Desktop.js file where the window creation is coded. But also here my alert will show after the notepad window is already closed. I've added the code in the first win.on() right under the beforeshow rule.
Can someone point me the correct way here please? I found several post on this issue, but I think this desktop example is probably an other case than the single examples in the other posts? I assume that making an autosave function while closing the window will have the same problem and seems to me as I didn't get the clue yet where to put things...
I'm trying to explore the example Desktop. I wanted to add a msg box to ask the user if they are sure to close for example the window notepad or not. My first idea was to add the code in the notepad.js
I've put it between layout and items:
...
// IE has a bug where it will keep the iframe's background visible when the window
// is set to visibility:hidden. Hiding the window via position offsets instead gets
// around this bug.
hideMode: 'offsets',
layout: 'fit',
beforeDestroy: function() {
alert('Hehe');
},
items: [{
xtype: 'htmleditor',
id: 'notepad-editor',
value: [...
When I close the Notepad window in the desktop it will close and after it is closed my alert popup is shown. I get the same result when I work with adding listeners.
Then I tried to move this to the /js/Desktop.js file where the window creation is coded. But also here my alert will show after the notepad window is already closed. I've added the code in the first win.on() right under the beforeshow rule.
Can someone point me the correct way here please? I found several post on this issue, but I think this desktop example is probably an other case than the single examples in the other posts? I assume that making an autosave function while closing the window will have the same problem and seems to me as I didn't get the clue yet where to put things...