I have a window with a cancel button and the default is [x]. When the user clicks the cancel button, he must check the specific flag and close the window and update db. I use me.close (this); to close the window for the cancel button. When the user clicks on [x], he must check one flag and update db, and then close the window. I added a listener to check this flag state. This listener works great. But after adding a listener by pressing the cancel button, the close event is called twice. Thus, db recovery occurs twice. Can anyone advise me how to handle the closing [x] event for a window
Ext.define('MyApp.view.updateForm', { extend: 'Ext.window.Window', height: 600, width: 800, layout: { type: 'absolute' }, title: 'Update Window', modal: true, initComponent: function() { Ext.applyIf(me, { items: [ { xtype: 'button', id:'btnCancel', handler : function(){ if(flag == true){
source share