Chandusangale / dropdown-check-list

Automatically exported from code.google.com/p/dropdown-check-list
1 stars 0 forks source link

Does not work with javascript clonenode #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using it in a table row that is cloned to allow the user to add multiple 
entries at once. The javascript to clone the row is:

function addAgeFields() {
  var newFields = document.getElementById('readroot_ages').cloneNode(true);
  newFields.style.display = '';
  var newField = newFields.childNodes;
  var insertHere = document.getElementById('writeroot_ages');
  insertHere.parentNode.insertBefore(newFields,insertHere);
  insertHere.appendChild(newField);
}

The dropdown list works fine in the original row (ID: readroot_ages), but when 
I try to use it in a row that was cloned, no dice.

Original issue reported on code.google.com by mbisga...@gmail.com on 28 Jul 2010 at 8:34

GoogleCodeExporter commented 9 years ago
I am guessing that since you are using clone, you do not have a unique ID on 
each select element. DDCL requires a unique id to function properly and uses a 
canned ID if nothing is explicitly supplied. Unfortunately, DDCL is not very 
smart about generating an id and will use the same one over and over. So DDCL 
can handle a single select without an id, but not multiples.

I will put this on the enhancement list.  A work-around for you would be to 
assign a unique id to each select as you clone it.

Original comment by womohun...@ittrium.com on 13 Sep 2010 at 8:42

GoogleCodeExporter commented 9 years ago
Version 1.1 does a better job of keeping the generated ids unique, so this 
problem should no longer arise.

Original comment by womohun...@ittrium.com on 21 Sep 2010 at 3:08

GoogleCodeExporter commented 9 years ago
Issue addressed with version 1.1.  Please let me know if you have any problems.

Original comment by womohun...@ittrium.com on 23 Sep 2010 at 3:31

GoogleCodeExporter commented 9 years ago
Just checked it with 1.1 - still seems to be an issue. I can workaround with 
unique IDs, but it's more of a pain

Original comment by mbisga...@gmail.com on 26 Sep 2010 at 9:49