Target specific row

Target specific row

chrischenchrischen Posts: 6Questions: 0Answers: 0
edited February 2010 in General
I load my data from server side, and I need to be able to target specific rows based on the IDs returned. I have a list and when you click on the list it creates an entry in another list, but if you delete the entry from the created list I need to be able to tell datables to de-select it from the master list. But the master list doesn't have IDs set to the td/tr elements.

How do set the IDs of the row cells from the IDs returned from server side? Column 0 is hidden and it is the ID.

RIght now I have it redraw the table, but this makes a request even if a request is not necessary.

Thanks

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Using fnRowCallback works well for this:

    [code]
    "fnRowCallback": function ( nRow, aData, iDisplayIndex ) {
    nRow.setAttribute('id', aData[0]);
    return nRow;
    }
    [/code]
    Allan
This discussion has been closed.