I have a button with a click function like this
var win = Ext.create('Ext.window.Window', {
title: 'We want your Feedback!',
cls: 'Hub-feedback-form',
//height: 320,
width: 300,
layout: 'fit',
closable: true,
closeAction: 'destroy',
items: [form]
});
win.show();
winVisible++ //winVisible is a global variable declared as 0.
if(winVisible % 2==0)
{
win.hide();
}
But what is happening is it is creating multiple instances of win, so everytime an insstance remains, how to modify the code so that every open instance of win gets removed. Please help!
You can call win.close(), it will remove the component and destroy it.