Format cell color based on JSON data
Format cell color based on JSON data
ecbahr
Posts: 2Questions: 0Answers: 0
I currently have a live datatable that is generated and using bServerSide that is updated with JQuery every 5 seconds. On each query to my database, I grab a bunch of information including a hex value of a color I would like to attach to my data. My question is whether I have to pass that color value as either a hidden JSON column or some mDataProp and do my color/cell processing every 5 seconds, or if I could attach some tag to my JSON data that I could use some sort of HTML or CSS scripting (similar to attaching a to JSON data.
ie
[code]<?php
...
while( $row=odbc_fetch_array($rs)){
$data[]=array(''.$row['foo'],
''.$row['bar'].'');
}
...
$response = json_encode(array(
...
'aaData' => $data
));
echo $response;
?>
[/code]
I hope that makes sense...
ie
[code]<?php
...
while( $row=odbc_fetch_array($rs)){
$data[]=array(''.$row['foo'],
''.$row['bar'].'');
}
...
$response = json_encode(array(
...
'aaData' => $data
));
echo $response;
?>
[/code]
I hope that makes sense...
This discussion has been closed.
Replies