Is it possible to add new table attribute with serverside data

Is it possible to add new table attribute with serverside data

JugramJugram Posts: 10Questions: 0Answers: 0
edited May 2013 in General
Currently what i get against my every table row is
[code]

[/code]

I am adding data-title attributes using
[code]
"fnCreatedRow": function (nRow, aData, iDataIndex) {
$(nRow).attr('data-title', 'abc'); }
[/code]

what i want to accomplish is to get my value instead of abc for data-title attribute in table row, is their any way of doing this in datatables? My data comes from serverside as

[code]
{"sEcho":"1","iTotalRecords":193,"iTotalDisplayRecords":193,"aaData":[{"UserId":0,"DT_RowId":123, "Data_Title": "Test"}]}
[/code]

Thanks in advance for help.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Looks like you are 99% of the way there already! Can you not use the following?

    [code]
    $(nRow).attr('data-title', aData.Data_Title);
    [/code]

    Allan
  • JugramJugram Posts: 10Questions: 0Answers: 0
    Thanks Allan
This discussion has been closed.