tags:

views:

24

answers:

1
var allRows = this.getTbodyEl().rows;
for (var i = allRows.length - 1; i >= 0; i--){
 var thisRowID = allRows[i].id;
 // Clean up any existing Drag instances
 if (myDTDrags[thisRowID]) {
    myDTDrags[thisRowID].unreg();
    delete myDTDrags[thisRowID];
 }
 // Create a Drag instance for each row
 myDTDrags[thisRowID] = new YAHOO.util.DDProxy(thisRowID);
};

I can't figure out why, but the above code is not yielding a DDProxy object for each row in my table. I have verified that the DDProxy code is all loaded and running properly by passing a string reference to a DOM element:

myDTDrags[thisRowID] = new YAHOO.util.DDProxy('yui-rec30');

This makes the corresponding row draggable as expected! I have also verified, using typeof, that the value of thisRowID is indeed of the type 'string' AND that the string contains the id of appropriate row elements.

What have I missed?

+1  A: 

UPDATE: My code posted above is correct. I was wrong in that the contents of my thisRowID variable did NOT contain a reference to an appropriate row element!

DustMason
Good work! I'm happy for you. Often, when something seems like it can't possibly be true, it isn't :-)
Pointy