row().node() doesn't take class names from cells

row().node() doesn't take class names from cells

galjegagaljega Posts: 4Questions: 0Answers: 0

When I take the node of 15th row for example (oTable.row(15).node()) it gives me this output:

<tr>
<td>13:00​</td>​
<td>22:55​</td>
</tr>

But that row has class names in cells. If I find this row manually in table and right click/inspect element I see this:

<tr role="row" class="odd">
<td class="column-depTime">13:00</td>
<td class="column-arrTime">22:55</td>
</tr>

I noticed that some rows are copied with class names, some don't. Any ideas how to get class names? I tried with deferRender: false, but no luck.

Replies

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Seems to work just fine for me: http://live.datatables.net/sabafad/1/edit . Please link to a test case (as noted in the forum rules) showing the issue.

    Allan

  • galjegagaljega Posts: 4Questions: 0Answers: 0

    Hi Allan!

    Finally I found what was wrong. I was adding class names with fnRowCallback, but it seems that it wasn't fully over before I call oTable.row(15).node(). That's the reason why it didn't take class names for some rows.

    Now, I add class names with fnCreatedRow and everything is working.

    Thanks!

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    I've been toying with the idea of decrementing fnRowCallback - it is potentially quite dangerous... I'll add a note to the documentation suggesting that createdRow be used instead (for the majority of cases!).

    Allan

This discussion has been closed.