DT_RowClass ServerSide
DT_RowClass ServerSide
Hi,
I have following initialization:
[code]
var mTable = $('#prediction').dataTable({
"sEcho": "1",
"bScrollCollapse": true,
"bPaginate": false,
"bFilter": false,
"aSync": true,
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"bInfo": false,
"bDeferRender": true,
"bAutoWidth": true,
"bJQueryUI": true,
/*"fnDrawCallback": function() {
$('.sku').html(add_opener);
},*/
"aoColumns": [
{"sClass": "d","sTitle": "D"},
{"sTitle": "Name"},
{"sClass": "n", "sTitle": "10/11"},
{"sClass": "s","sTitle": "11/11"},
{"sClass": "f","sTitle": "12/11"},
{"sClass": "e","sTitle": "1/12"}],
"sAjaxSource": "get_predictions.php?itype=year" //year tai month
});
[/code]
I get Ajax to return data OK but DT_RowClass definition is not working.
MySQL Select:
....
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => count($a),
"iTotalDisplayRecords" => count($a)
"aaData" => array());
MySQL loop:
$row["DT_RowId"][] =$id;
$row["DT_RowClass"][] = "Test";
$row[] = 'd';
$row[] = 'name';
$row[] = 'data1';
$row[] = $i->get_data1();
....
echo json_encode( $output );
----------
So, in client side row_id is correct, etc, but row class is not "updated".
What am I missing here?
I have following initialization:
[code]
var mTable = $('#prediction').dataTable({
"sEcho": "1",
"bScrollCollapse": true,
"bPaginate": false,
"bFilter": false,
"aSync": true,
"bProcessing": true,
"bServerSide": true,
"bStateSave": true,
"bInfo": false,
"bDeferRender": true,
"bAutoWidth": true,
"bJQueryUI": true,
/*"fnDrawCallback": function() {
$('.sku').html(add_opener);
},*/
"aoColumns": [
{"sClass": "d","sTitle": "D"},
{"sTitle": "Name"},
{"sClass": "n", "sTitle": "10/11"},
{"sClass": "s","sTitle": "11/11"},
{"sClass": "f","sTitle": "12/11"},
{"sClass": "e","sTitle": "1/12"}],
"sAjaxSource": "get_predictions.php?itype=year" //year tai month
});
[/code]
I get Ajax to return data OK but DT_RowClass definition is not working.
MySQL Select:
....
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => count($a),
"iTotalDisplayRecords" => count($a)
"aaData" => array());
MySQL loop:
$row["DT_RowId"][] =$id;
$row["DT_RowClass"][] = "Test";
$row[] = 'd';
$row[] = 'name';
$row[] = 'data1';
$row[] = $i->get_data1();
....
echo json_encode( $output );
----------
So, in client side row_id is correct, etc, but row class is not "updated".
What am I missing here?
This discussion has been closed.
Replies
$row["DT_RowId"][] =$id;
-->
$row["DT_RowId"] =$id;