Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82109

Please un-deprecate fnRender

$
0
0
HI Allan,

First of all, great job on datatables! It works very well and looks great. I've been using it since 2009 (?) for a variety of projects.

After upgrading from 1.8.3 to 1.9.4 I discovered that fnRender is deprecated in column defs. This is a bummer for me since I was doing things like this:

$('table').dataTables({
aoColumns : [
{
mDataProp: 'summaryStatistics.rating',
bSortable : true,
fnRender : function (obj) {
var ss = obj.aData;
return ss.rating + ' | ' + ss.numUsers + ' users'
}
}
...
]
});

where the data looks like this

[
{ "summaryStatistics" : { "rating" : 3.0, "numUsers" : 400} },
{ "summaryStatistics" : { "rating" : 1.0, "numUsers" : 23} }
]

I tried to change fnRender to mRender, but discovered the function is called differently. mRender is called with the mData value, while in this case is the rating. But fnRender was called with the entire row's data, so I can look at multiple fields of the row. I could change mDataProp to just 'summaryStatistics', but then I would lose the sorting ability on the rating. If there is no workaround for this, I would suggest un-deprecating fnRender.

Thanks!

Jeff

Viewing all articles
Browse latest Browse all 82109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>