no events are not cloned, I've had the same problem, as Erik says you
gotta reapply events
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Erik Beeson
Sent: Wednesday, 20 December 2006 3:33 PM
To: jQuery Discussion.
Subject: Re: [jQuery] events on cloned objects?
 
I think, by design, events aren't cloned. Just reapply the click event
handler when you do the cloning:

$(...).clone().click(click_handler).appendTo(...);

The docs should probably clarify this behavior.

--Erik
On 12/19/06, Shahbaz <[EMAIL PROTECTED]> wrote:
I have a table with several rows but a single column, each cell in
this column has a class "X".
One of the cells (the last row) has a "click" event, when clicked, it
just prints a log statement (confirmation that it received the event). 

In my $(document).ready... function, I clone the single column to
create two more rows (basically the column with class "X" is the
template column).

I expect that whenever I click on the cell with the "Click" event...or 
ANY OF ITS CLONES in the newly created columns, I"ll get a log
statement confirming the click.  For some reason, only one of the
cells confirms the click, others don't!

How can I get the click event to be understood by all cells, cloned 
copies or not?

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/  <http://jquery.com/discuss/> 
 
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to