Using Same mData Multiple Times with fnRender
Using Same mData Multiple Times with fnRender
yahyaerturan
Posts: 4Questions: 0Answers: 0
Version: DataTables 1.9.4
I want to use same "oObj.aData.id_company" in multiple columns but it can't render it. It's all OK if I use it only one time as in second code block below:
[code]
var col_def = [
{ "mData": "id_company", "sTitle":"Edit","fnRender" : function (oObj){
return 'Edit';
}
},
{ "mData": "company_name", "sTitle":"Company Name", "sWidth":"50%"},
{ "mData": "id_company", "sTitle":"Delete","fnRender" : function (oObj){
return 'Delete';
}
}
];
[/code]
[code]
var col_def = [
{ "mData": "company_name", "sTitle":"Company Name", "sWidth":"50%"},
{ "mData": "id_company", "sTitle":"Delete","fnRender" : function (oObj){
return 'Delete';
}
}
];
[/code]
I am doing wrong or missing something?
Here is the code for debug: http://debug.datatables.net/unocid
I want to use same "oObj.aData.id_company" in multiple columns but it can't render it. It's all OK if I use it only one time as in second code block below:
[code]
var col_def = [
{ "mData": "id_company", "sTitle":"Edit","fnRender" : function (oObj){
return 'Edit';
}
},
{ "mData": "company_name", "sTitle":"Company Name", "sWidth":"50%"},
{ "mData": "id_company", "sTitle":"Delete","fnRender" : function (oObj){
return 'Delete';
}
}
];
[/code]
[code]
var col_def = [
{ "mData": "company_name", "sTitle":"Company Name", "sWidth":"50%"},
{ "mData": "id_company", "sTitle":"Delete","fnRender" : function (oObj){
return 'Delete';
}
}
];
[/code]
I am doing wrong or missing something?
Here is the code for debug: http://debug.datatables.net/unocid
This discussion has been closed.
Replies
Allan
[code]
"mRender":function(data,type,row) {
return ...
}
[/code]
is simply rocks with using [code] "mData" : null [/code]. Thanks for great plugin.