Forms in Q.Window

0 views
Skip to first unread message

matt vella

unread,
Aug 26, 2010, 11:22:08 AM8/26/10
to Qutensil
Hello-

If I have a Q.Window populated with an HTML form, the window is
closed, and then later I create the same form in a new Q.Window, it
seems the browser does not handle the new form properly - I believe
this is because the old form is not actually destroyed, and therefore
there are duplicate elements rendered on the page.

Is there some way to get around this, other than using a a random
string to name the form and its elements each time? Could Q.Window
destroy its content on close? Or is there already some option to
force this to happen?

Thanks!
Matt

jbogdani

unread,
Aug 27, 2010, 1:29:49 AM8/27/10
to Qutensil
Hi,
I've solved making Q.Window destroy the window when it closes:
q.js, method: hide check the added by me lines:
// hide holder
hide: function(force) {
if (Q.active || force) {
Q.active = false;

if (force) {
this.is_over = false;
this.holder.hide();
// added by me
this.holder.remove();
} else {
this.holder.fade({ duration: 0.05 });
// added by me
this.holder.remove();
}
if (this.input)
this.input.blur();
Q.callback('onHide', this);
}
},
I was also thinking to add minimize & maximize buttons to the window
to have more control on it

wonderingwout

unread,
Aug 27, 2010, 2:56:59 AM8/27/10
to Qutensil
You could as well work with an onHide callback.
Than you don't need to change the source because that will make
switching to a new release a pain.

In the callback you can remove all the contents of the window, like
so:

onHide: function(self) {
self.update('');
}

Minimize / maximaize buttons are a good idea, I'll look into it.

Wout

matt vella

unread,
Aug 27, 2010, 3:12:17 PM8/27/10
to Qutensil
Thanks to both of of you for your suggestions!

Matt
Reply all
Reply to author
Forward
0 new messages