Well, recently I had some problems when using some YUI Panels that included [code]]czo4OlwiPHNlbGVjdD5cIjt7WyYqJl19[[/code] inputs, and checkbox [code]]czo3OlwiPGlucHV0PlwiO3tbJiomXX0=[[/code]s. The problem had to do with the fact that yui copies your panel contents using the native cloneNode() javascript function. Similar problems have been seen by others, but I've yet to hear a solution or fix provided by the YUI team. The problem doesn't originate from Yahoo!, rather IE doesn't copy across selectedIndex values when using the cloneNode(true) function (which copies all inner elements of the element being copied. The solution, set the copied elements values with the original elements values after the cloneNode() function is run. This worked fine, I just made a small function that received 2 parameters, the original and cloned elements, and then went through and grabbed all the [code]]czo4OlwiPHNlbGVjdD5cIjt7WyYqJl19[[/code], checkboxes, and radio buttons, and copied the original values of selectedIndex/checked/selected, into the cloned elements values. It would be nice if this was taken into account in the yui framework though.
After getting that to work, I then noticed that events I had attatched to some checkboxes using YAHOO.util.Event.addListener() weren't being copied over either. I had to further modify my function to go through and copy events over as well. This wasn't too difficult with the YAHOO.util.Event.getListeners() function though. Anyone else had similar issues?
yui and cloneNode()
Well, recently I had some problems when using some YUI Panels that included [code]]czo4OlwiPHNlbGVjdD5cIjt7WyYqJl19[[/code] inputs, and checkbox [code]]czo3OlwiPGlucHV0PlwiO3tbJiomXX0=[[/code]s. The problem had to do with the fact that yui copies your panel contents using the native cloneNode() javascript function. Similar problems have been seen by others, but I've yet to hear a solution or fix provided by the YUI team. The problem doesn't originate from Yahoo!, rather IE doesn't copy across selectedIndex values when using the cloneNode(true) function (which copies all inner elements of the element being copied. The solution, set the copied elements values with the original elements values after the cloneNode() function is run. This worked fine, I just made a small function that received 2 parameters, the original and cloned elements, and then went through and grabbed all the [code]]czo4OlwiPHNlbGVjdD5cIjt7WyYqJl19[[/code], checkboxes, and radio buttons, and copied the original values of selectedIndex/checked/selected, into the cloned elements values. It would be nice if this was taken into account in the yui framework though.
After getting that to work, I then noticed that events I had attatched to some checkboxes using YAHOO.util.Event.addListener() weren't being copied over either. I had to further modify my function to go through and copy events over as well. This wasn't too difficult with the YAHOO.util.Event.getListeners() function though. Anyone else had similar issues?