fnCreatedCell to mRender
fnCreatedCell to mRender
sdinesh21
Posts: 37Questions: 0Answers: 0
Hi,
I am using the fnCreatedCell to format my cell value based on JSON data for that column. How do I rewrite this using mRender? Is it more efficient (memory wise) using mRender?
[code]
{ "sTitle": "Severity", "bVisible": true, "mData" : "5", "sWidth": "10%", "bSortable": true,
"fnCreatedCell": function(nTd, sData, oData, iRow, iCol)
{
switch(sData)
{
case 1:
$(nTd).addClass('alertSeverityLow');
$(nTd).text("Low");
break;
case 2:
$(nTd).addClass('alertSeverityMedium');
$(nTd).text("Medium");
break;
case 3:
$(nTd).addClass('alertSeverityHigh');
$(nTd).text("High");
break;
case 4:
$(nTd).addClass('alertSeverityCritical');
$(nTd).text("Critical");
break;
}
}
}
[/code]
I am using the fnCreatedCell to format my cell value based on JSON data for that column. How do I rewrite this using mRender? Is it more efficient (memory wise) using mRender?
[code]
{ "sTitle": "Severity", "bVisible": true, "mData" : "5", "sWidth": "10%", "bSortable": true,
"fnCreatedCell": function(nTd, sData, oData, iRow, iCol)
{
switch(sData)
{
case 1:
$(nTd).addClass('alertSeverityLow');
$(nTd).text("Low");
break;
case 2:
$(nTd).addClass('alertSeverityMedium');
$(nTd).text("Medium");
break;
case 3:
$(nTd).addClass('alertSeverityHigh');
$(nTd).text("High");
break;
case 4:
$(nTd).addClass('alertSeverityCritical');
$(nTd).text("Critical");
break;
}
}
}
[/code]
This discussion has been closed.
Replies
Allan