PDA

View Full Version : Objects in a window are cloned



Radius-Service
15 Sep 2010, 1:23 AM
Hi all. I created form in a window, when I click on button, open this window, and again click on the button (I don't close this window) all objects in form are "cloning". I must check - if window object created, before I open window, but I don't know why!


function displayFormWindow()
{
if(!MyWindow.isVisible())
{
resetMyForm();
MyWindow.show();
}
else
{
MyWindow.toFront();
}
}

This code construct don't work, as to me to make this?

laurentParis
15 Sep 2010, 4:17 AM
for your handler button, use only


handler: function () {
MyWindow.show()
}
and add an event on your window


MyWindow.on('afterlayout', function () {
resetMyForm();
}, this, {single: true});

Radius-Service
6 Oct 2010, 12:47 AM
Hm...I have one more question. How to delete window with all objects. After deleted on button click open window with new objects. Just I try to do this, but window doesn't open

Condor
6 Oct 2010, 1:02 AM
Closing a window will destroy all it's nested components (you didn't 'render' components did you?).