Hey Dave, I'm glad to hear you are using the Copy Events plugin. There is a new version in SVN which is compatible with both 1.1.1(and less) and the nightlies of jQuery. Just wanted to give you heads up so that when you upgrade to the latest jQuery, you know you need to also upgrade to the latest Copy Events plugin. You can actually go ahead and get it now if you wanted since it works with both versions.
-- Brandon Aaron On 2/23/07, Dave Treagust <[EMAIL PROTECTED]> wrote: > > Hi > > I found this reply really useful.. > > Event handlers are not preserved when cloning elements. > So: > * you can reassign the event handlers to the cloned elements or > * you can use the copyEvents plugin: > <http://www.learningjquery.com/2007/01/copy-events-from-one-element-to-another> > > Best. > -- Choan <http://choangalvez.nom.es/> I have a table that has a hidden 1st > row, this is the chunk of code that gets cloned :) > This row has several form fields and a mouseover of the TR which toggles a > delete image for that row. > > I tried several ways todo it and this was the ONLY WAY TODO IT. > > Though looking at the 1st option i did'nt reassign the event handlers so i > opted for the copyEvents plugin. > > Triggsley > > > On 22/02/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > > Hi, > > If I have > > $(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append('<input > type="text" value="" size="10" class="editableItem">'); > > What is the best way to get a reference to the newly created text field? > Note that it does not have an ID and I would prefer a more generic way of > finding it other than "input.editableItem" because on PC IE 6, if I insert > multiple text fields, like the above, this call ... > > $(this).parents("div.sidebarToDo").find("input.editableTDItem"); > > only returns a correct reference for the first time a textfield is added. I > cant get the most recent addition with the above call if there had been text > fields added in the past. > > Thanks, please let me know what info I can provide to make this question > more clear, - Dave > > You could try this: > > var editableitem = $('<input type="text" value="" size="10" > class="editableItem">'); > $(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append(editableitem); > editableitem.change(checkText); > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > > > > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
