Display sSpecific
Display sSpecific
amun1000
Posts: 7Questions: 1Answers: 0
Hi Just wondering why I'm getting the error dialog when it calls
[code]return oCol.fnRender( {
"iDataRow": iRow,
"iDataColumn": iCol,
"oSettings": oSettings,
"aData": oSettings.aoData[iRow]._aData,
"mDataProp": oCol.mData
}, _fnGetCellData(oSettings, iRow, iCol, 'display') [/code]
Table is initialised with the following
[code]
var oTable = $('#example').dataTable({
"bServerSide": false,
"sAjaxSource": "/Vehicle/GetParts",
"sAjaxDataProp": "",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "id", "value": "@Model.Id" } );},
"bProcessing": true,
"aoColumns": [
{
"sName": "Part",
"bSearchable": true,
"bSortable": true,
"fnRender": function (oObj) {
return oObj.aData.DisplayName;
}
},
{
"sName": "Price",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return '';
}
},
{
"sName": "Notes",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return '';
}
},
{
"sName": "Action",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return buildActionButtons(oObj);
}
}
],
"fnCreatedRow": function (nRow, aData, iDataIndex) {
$(nRow).attr('data-for-part', aData.Id);
$('td:eq(0)', nRow).css('width', '320px');
//Pending
if (aData.Status == 0) {
$(nRow).addClass('status-forsale');
}
else if (aData.Status == 1) {
$( nRow).addClass('status-pending');
}
if (aData.Status == 2) {
$(nRow).addClass('status-sold');
}
}
});[/code]
[code]return oCol.fnRender( {
"iDataRow": iRow,
"iDataColumn": iCol,
"oSettings": oSettings,
"aData": oSettings.aoData[iRow]._aData,
"mDataProp": oCol.mData
}, _fnGetCellData(oSettings, iRow, iCol, 'display') [/code]
Table is initialised with the following
[code]
var oTable = $('#example').dataTable({
"bServerSide": false,
"sAjaxSource": "/Vehicle/GetParts",
"sAjaxDataProp": "",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "id", "value": "@Model.Id" } );},
"bProcessing": true,
"aoColumns": [
{
"sName": "Part",
"bSearchable": true,
"bSortable": true,
"fnRender": function (oObj) {
return oObj.aData.DisplayName;
}
},
{
"sName": "Price",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return '';
}
},
{
"sName": "Notes",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return '';
}
},
{
"sName": "Action",
"bSearchable": true,
"bSortable": false,
"fnRender": function (oObj) {
return buildActionButtons(oObj);
}
}
],
"fnCreatedRow": function (nRow, aData, iDataIndex) {
$(nRow).attr('data-for-part', aData.Id);
$('td:eq(0)', nRow).css('width', '320px');
//Pending
if (aData.Status == 0) {
$(nRow).addClass('status-forsale');
}
else if (aData.Status == 1) {
$( nRow).addClass('status-pending');
}
if (aData.Status == 2) {
$(nRow).addClass('status-sold');
}
}
});[/code]
This discussion has been closed.
Replies
[quote]fnRender:
Please note that this option has now been deprecated and will be removed in the next version of DataTables. Please use mRender / mData rather than fnRender.[/quote]
Allan