Switch from fnRender to mRender
Switch from fnRender to mRender
lcurtin
Posts: 6Questions: 0Answers: 0
I have always used fnRender to combine columns.
[code]
"aoColumnDefs": [
{ // merge address1 and 2 into this column
"fnRender": function ( oObj ) {
return oObj.aData[2] +'
'+ oObj.aData[3];
},
"aTargets": [ 2 ]
},
{ // hide address2 column
"bVisible": false,
"aTargets": [3]
{
]
[/code]
I am at a loss doing this with mData and mRender.
[code]
mRender: function ( data, type, row ) {
var formatted = ""
formatted = (data + '
' + data[2])
return formatted;}
},
[/code]
Returns "Alexandra e". The field and the third character of the field.
Help, please. What simple thing am I not doing?
[code]
"aoColumnDefs": [
{ // merge address1 and 2 into this column
"fnRender": function ( oObj ) {
return oObj.aData[2] +'
'+ oObj.aData[3];
},
"aTargets": [ 2 ]
},
{ // hide address2 column
"bVisible": false,
"aTargets": [3]
{
]
[/code]
I am at a loss doing this with mData and mRender.
[code]
mRender: function ( data, type, row ) {
var formatted = ""
formatted = (data + '
' + data[2])
return formatted;}
},
[/code]
Returns "Alexandra e". The field and the third character of the field.
Help, please. What simple thing am I not doing?
This discussion has been closed.
Replies
[code]
return data +'
'+ row[3];
[/code]
Allan