fnRender applied multiple times

fnRender applied multiple times

zermelozermelo Posts: 2Questions: 0Answers: 0
edited December 2012 in General
Hi,
I wanto to display the same data source column (col1 in the example below) twice in the datatable:
the first time without rendering, while the second times applying a rendering function (renderCol1).
[code]
$(document).ready( function() {
var dataTableSettingsLocal = {
"bLengthChange": true,
"bServerSide": true,
"sAjaxSource": "list.json",
"bProcessing": true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "mDataProp": "col1"},
{ "mDataProp": "col2" },
{ "mDataProp": "col1", "fnRender": renderCol1 }
]
...
});
[/code]
The problem is that I get the function renderCol1 applied to the first colum although I don't call it.
How can I avoid this side-effect?

Thanks

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    fnRender is deprecated and removed in 1.10 - I'd very strongly suggest you use mRender which does not suggest from the issue you node above (a limitation in how fnRender works and one of the reasons it is being removed!).

    Allan
  • zermelozermelo Posts: 2Questions: 0Answers: 0
    I have found a work-around for those bound to use fnRender: just declare mDataProp null. In the example, it amounts to
    [code]

    { "mDataProp": null, "fnRender": renderCol1 }

    [/code]
This discussion has been closed.