Datatables plugin - how to create <td> attributes when calling fnAddData() to create table rows

Datatables plugin - how to create <td> attributes when calling fnAddData() to create table rows

Hello,
Prior to trying out Datatables, I basically created my Html table manually and used jQuery .appendTo() to add the rows. It was quite fast.
For example:

  1. $(this).find("exposureProfile node").each(function () {
  2.   // init vars here... 
  3.   myRow = "<tr><td class='td_pfid'>" + pfId + "</td>";
  4.   myRow += "<td class='td_nodedate'>"+ nodeDate + "</td><td>" + term +
  5.               "</td><td align=right>" + exposure + "</td></tr>";                
  6.     // add more rows to myRow
  7.     $(myRow).appendTo("#pftable");         // APPEND TO MY TABLE USING STANDARD JQRY !
  8. }



Now I'm trying to retrofit Datatables and therefore dynamically add the rows using fnAddData(), and noticed it's much slower using fnAddData(). It does work but slowly

Bigger question: How do I specify the attributes of my <td> cells when calling into fnAddData() API, for example <td class='td_pfid'> .

I need this because I have a click event on the <tr> rows which searches for these attributes :

  1. $("#pftable tbody tr").click(function (event) { 
  2.    ...
  3.    var thisPfId = $(this).find('.td_pfid').text();         // Find Portfolio Id and Node Date !!
       var thisDate = $(this).find('.td_nodedate').text();
  4.    ...
  5. }

Of course, I'd like to speed the table rendering up a bit, but I first need to figure out how to create attribues in my <td> elements.

Thanks ahead of time for your responses !

Regards,
Bob