Server Side processing and adding classes

Server Side processing and adding classes

wouterstevenwoutersteven Posts: 8Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
Good morning,

I was able to get server side processing working with a remote data source, however am wondering how i can add classes to the table rows and table cells that are randomly generated. For example, want some rows to be

.. where nID is the ID of a primary key in a database. A jQuery event (onclick) can then read that to know which record it is and can launch an edit lightbox for example.

Similarly I'm looking to add classes to individual cells..

Is that possible to do that using Server Side processing? Now it seems to be returning a JSON string, but is there a way to control the output further?

- WS

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    A couple of options:

    - DT_RowId and DT_RowClass can be used to add IDs and classes - but not to add arbitrary attributes.

    - Use fnDrawCallback or fnRowCallback to add the attributes you want based on the data

    - Use fnCreatedRow

    Allan
  • wouterstevenwoutersteven Posts: 8Questions: 0Answers: 0
    Thanks, fnRowCallback() was exactly what I needed :)
This discussion has been closed.