[jQuery] clone help
[jQuery] clone help
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Thank you Karl. I will be more careful next
time.</FONT></DIV>
<DIV><FONT face=Arial
size=2>-----------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The below </FONT></DIV>
<DIV>$('#$id').hide().bla-bla.appendTo('#verticals').show();</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>does not work for me because since it is not
removed, when you submit it is still part of the array and creates double
values.</FONT></DIV>
<DIV><FONT face=Arial
size=2>----------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman"
size=3>$('#$id').remove().clone(true).appendTo('#verticals');<BR>is wrong.
because of remove() (it kills everything because of memory IE leaks).<BR>you
sould use this chain instead:<BR><BR>$('#$id').appendTo('#verticals');<BR><BR>or
somethin like
that:<BR><BR>$('#$id').hide().bla-bla.appendTo('#verticals').show();<BR><BR>2008/1/17,
Lionel Martelly <</FONT><A href=""><FONT face="Times New Roman"
size=3>lmartelly@haitiwebs.net</FONT></A><FONT face="Times New Roman"
size=3>>:<BR>><BR>> I read somewhere that events must be bind when
cloning so I remove the<BR>> parent. Please how do I bind the context
menu?<BR>><BR>> $('#$id').contextMenu('chooser',
{<BR>> bindings:
{<BR>>
'vert': function(t) {<BR>>
$('#$id').remove().clone(true).appendTo('#verticals');<BR>>
},<BR>>
'horiz': function(t) {<BR>>
$('#$id').remove().clone(true).appendTo('#horizontals');},<BR>>
}<BR>> });<BR>><BR>> I am also loosing the draggable/sortable. I
do not know how to bind it.<BR>><BR>> Thank you.</FONT><BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>_______________________________<BR>Lionel
Martelly</FONT></DIV></BODY></HTML>