Adding css class to rows - server side
Adding css class to rows - server side
I have an problem. I'm using DataTables with server-side version. I've added smth like "priority" to projects, each one have a "color" - red is most important of them.. i'm selecting it from mysql.
It looks like this:
table projects, id, title, date, and priority
priority
1 - red
2- light red
3- green
4- light green
And i would like to get this from mysql and add to " when I'm getting it to datatables - is it possible ?
It looks like this:
table projects, id, title, date, and priority
priority
1 - red
2- light red
3- green
4- light green
And i would like to get this from mysql and add to " when I'm getting it to datatables - is it possible ?
This discussion has been closed.
Replies
[code]
for ( var i=0, iLen=oSettings.aoData.length ; i
see DT_RowClass on http://www.datatables.net/usage/server-side
[code]
{
"sEcho": 3,
"iTotalRecords": 57,
"iTotalDisplayRecords": 57,
"aaData": [
{
"DT_RowId": "row_7",
"DT_RowClass": "gradeA",
"0": "Gecko",
"1": "Firefox 1.0",
"2": "Win 98+ / OSX.2+",
"3": "1.7",
"4": "A"
},
{
"DT_RowId": "row_8",
"DT_RowClass": "gradeA",
"0": "Gecko",
"1": "Firefox 1.5",
"2": "Win 98+ / OSX.2+",
"3": "1.8",
"4": "A"
},
...
]
}
[/code]
(I'm not sure if you need to use objects instead of arrays to make this work, but i think you do, else how/where would you specify DT_RowClass?)