title: pass value to onclick event for table row
body: <p>I have a table row that i am creating on Ajax call. I would want to associate an onlclick event.  I am unable to pass an element from an array which i am traversing (which d[i] as per the code shown below)
  So i am unable to grab the array element in the click event </p>
  
  <pre><code>var d = $.parseJSON(data.codes);
  
  for (var i = 0; i &lt; d.length; i++) {
    var currentRow = $('&lt;tr&gt;');
    currentRow.append($('&lt;td&gt;').html(d[i].id));
    currentRow.attr("class", "sourceCodeRow grid-row");
    currentRow.append($('&lt;td&gt;').html(d[i].name));
    currentRow.append($('&lt;td&gt;').html(d[i].description));
  
    currentRow.click(function (f) {
      //want to display name from d[i]
      // alert(d[i].name);
  
    });
  
    $('#table-id').append(currentRow);
  }
  </code></pre>