I am attempting to use mDataProp, fnRender, and bUseRendered to sort a column based on an ID, but display a Name. I see that bUseRendered is deprecated and that the API suggests using mData and mRender, but with those I can’t get any data to populate in my column. Here is my code that kind of works, but does not render what I would like it too:
$(document).ready(function() {
oTable = $('#example').dataTable( {
"sAjaxSource": "source.php",
"aaSorting": [],
"aoColumns": [
{ "mDataProp" : "NameID",
"fnRender" : "Name",
"bUseRendered": false},
{ "mDataProp" : "Priority"},
{ "mDataProp" : "Action"}
]
} );
} );
And here is my attempt using mData, but this will not populate my first column and gives me an error popup.
$(document).ready(function() {
oTable = $('#example').dataTable( {
"sAjaxSource": "source.php",
"aaSorting": [],
"aoColumns": [
{ "mData" : "NameID",
"mRender" : "Name"},
{ "mDataProp" : "Priority"},
{ "mDataProp" : "Action"}
]
} );
} );
Any ideas how to get it to display my Name, but sort by NameID?
1 Answer