Friends

I am using MochiKit.DOM to build a table and i want to add an event
listener to each row.  I tried this (row_label is set before the
function is called)

// Helper function 
var row_label;
row_display = function (row) {
  var tr = TR({"id":row_label}, map(partial(TD, null), row));
  tr.addEventListener("click", edit_table, false);
  return tr;
}

This is not working, the event does not arive.  I assume it is because I
add the eventListener before the row is in the document, but I do not
know.

I tried adding the listener to the table but I get a cell event and I
need access to the row.  If I used IE4 I could say e.target.parent in
the handler but I do not so can not.

How can I attach a listener to a dynamically constructed table such that
I have access to the row?

thanks
Worik

Reply via email to