fnCreatedCell function does not do anything
fnCreatedCell function does not do anything
k_rell23
Posts: 3Questions: 0Answers: 0
Hello. I am having problems with the fnCreatedCell function. It does not do anything. I have tested this by ading an alert() into this initialisation:
[code]
mTable = $("#mTable").dataTable({
bJQueryUI: true,
bProcessing: true,
bServerSide: true,
sPaginationType: "full_numbers",
sAjaxSource: "serverGet.php",
fnServerParams: function (aoData) {
aoData.push(
{name: "dbc_db", value: "......"},
{name: "dbc_col", value: "......"},
{name: "dbc_key", value: "......"}
);
},
aoColumnDefs: [{
aTargets: ["_all"],
fnRender: function (o, val) {
return processOutput(o.aData[o.iDataColumn]);
},
fnCreatedCell: function(nTd, sData, oData, iRow, iCol) {
alert();
}
},{
aTargets: [0],
bSortable: false
}],
aaSorting: [[1, "asc"]]
});
[/code]
As soon as the page finished loading, there is no alert message appearing.
I have tried to remove fnRender, thinking that the both cannot work simultaneously, but that does not help.
I am curios whether this is a bug in 1.9 or if I am doing something wrong.
Thanks !
[code]
mTable = $("#mTable").dataTable({
bJQueryUI: true,
bProcessing: true,
bServerSide: true,
sPaginationType: "full_numbers",
sAjaxSource: "serverGet.php",
fnServerParams: function (aoData) {
aoData.push(
{name: "dbc_db", value: "......"},
{name: "dbc_col", value: "......"},
{name: "dbc_key", value: "......"}
);
},
aoColumnDefs: [{
aTargets: ["_all"],
fnRender: function (o, val) {
return processOutput(o.aData[o.iDataColumn]);
},
fnCreatedCell: function(nTd, sData, oData, iRow, iCol) {
alert();
}
},{
aTargets: [0],
bSortable: false
}],
aaSorting: [[1, "asc"]]
});
[/code]
As soon as the page finished loading, there is no alert message appearing.
I have tried to remove fnRender, thinking that the both cannot work simultaneously, but that does not help.
I am curios whether this is a bug in 1.9 or if I am doing something wrong.
Thanks !
This discussion has been closed.
Replies
It seems that I was using the older 1.8 version of DataTables.
Sorry for wasting your time.
Allan