fnRowCallback only working on 1st row
fnRowCallback only working on 1st row

i have written a datatable with an ajax source in which i need one column to be styled like a progressbar I have tried to do this using fnRowCallback. with limited success as it only applies the styling to the first row only.. your help would be greatly recieved.
my code and json data are below
var table = $('#MyCourses').DataTable({
//"ajax": "<%=ServerRoot%>/scripts/asp/Handle.asp?value=Home&arg=MyCourses",
"ajax": "<%=ServerRoot%>/scripts/asp/json.txt",
"sScrollY": "270px",
"bDestroy": true,
"bPaginate": false,
"bScrollCollapse": false,
"bInfo": false,
"bAutoWidth":false,
"bFilter": false,
"columns" : [
{
"orderable":false,
"data": "CourseID",
"sWidth": "20px"
},
{
"className":'details-control',
"orderable":false,
"data": null,
"sWidth": "15px",
"defaultContent": ''
},
{
"className": 'empNameClass',
"sWidth": "185px",
"data": "CourseName"
},
{
"className": 'empNameClassCnr',
"sWidth": "25px",
"data": "OnlineCourse"
},
{
"sWidth": "25px",
"orderable":false,
"data": "PcentCompleted",
"defaultContent": ''
},
{
"className": 'empNameClass',
"sWidth": "200px",
"data": null
},
{
"className": 'empNameClassCnr',
"sWidth": "25px",
"data": "Status"
},
{
"sWidth": "200px",
"data": "CourseDescription"
}
],
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var ProgressValue = $('td:eq(4)', nRow).html();
/* Turn the fifth row -- progress -- into a progressbar with jQuery UI styling */
progressString = '<div class="ui-progressbar ui-widget-content"><div class="ui-progressbar-value ui-widget-header ui-corner-left" style="height:20px;width:'+ProgressValue+'%; overflow:hidden"></div></div>';
$('td:eq(5)', nRow).html(progressString);
$('td:eq(2)', nRow).attr( 'title', $('td:eq(7)', nRow).html() );
$('td:eq(5)', nRow).attr( 'title', ProgressValue+'% Completed' );
table.columns( [ 0, 4, 7 ] ).visible( false, false );
//table.draw(); // adjust column sizing and redraw
return nRow;
}
});
json data
{
"data": [
{
"CourseID": "627",
"CourseName": "L3 Treating Customers Fairly (CCAS Accredited)",
"CourseDescription": "Customer experience is one of the most important elements when dealing with people in a sales environment. Giving great customer service entices people to remain loyal with the brand, creating great customer return and acceptance of new products",
"OnlineCourse": "Yes",
"PcentCompleted": "99",
"Status": " Ready for Quiz",
"OnlineDuration": "1 Hours",
"NumberOfModules": "4",
"HasQuiz": " Yes 12 Questions",
"PassMarkPercentage": " 85% or higher to pass",
"ClassroomDuration": "1 Days",
"Supplier": "LMS",
"CourseCategory": "CCAS L3",
"ClassRoomDate": ""
},
{
"CourseID": "853",
"CourseName": "Treating Customers Fairly (Unaccredited)",
"CourseDescription": "Customer experience is one of the most important elements when dealing with people in a sales environment. Giving great customer service entices people to remain loyal with the brand, creating great customer return and acceptance of new products.",
"OnlineCourse": "Yes",
"PcentCompleted": "33",
"Status": " In Progress",
"OnlineDuration": "1 Hours",
"NumberOfModules": "3",
"HasQuiz": " Yes 12 Questions",
"PassMarkPercentage": " 85% or higher to pass",
"ClassroomDuration": "1 Days",
"Supplier": "Dan Cocksedge",
"CourseCategory": "Generalsit",
"ClassRoomDate": ""
}
]
}
This discussion has been closed.