fnDraw with addClass

fnDraw with addClass

vzhilovvzhilov Posts: 3Questions: 0Answers: 0
edited September 2013 in General
Hello, I want to have table with read/unread rows. The server-side script provides a hidden column with read/unread status and I use this to add 'unread class to the needed rows. I mark rows as unread at the initialization with

[code]"fnInitComplete": function (oSettings, jason) {
for (i=0; i

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I would suggest you use fnGetNodes and fnGetData - not the settings object, which should be avoided if at all possible.

    Also, are you using server-side processing (please provide a test case or debug trace as noted in the forum rules) - if so, then fnDraw is async - your function will run before the new data has loaded.

    Allan
  • vzhilovvzhilov Posts: 3Questions: 0Answers: 0
    Thank you for your answer, Allan! I got it on async. I have managed to go about it by putting the above code to fnDrawCallback so it adds "unread" class each time the table redraws. I don't even this in fnInitComplete anymore, only in fnDrawCallback is enough. This is now works fine.

    I didn't manage to "switch" to fnGetNodes and fnGetData from object settigns though. I'm kind of couldn't figure out what to add the class to. if I do:

    [code]
    var nNodes = oTable.fnGetNodes();
    for (i=0; i
This discussion has been closed.