how to reference the TD when using mRender
how to reference the TD when using mRender
When using mRender as a function callback, how do you reference the TD that the cell will correspond to - for example if I did
[code]
"mRender": function(data,type,full) {
if( full.team_colour == 'green' )
{
$(this).parents('td').css('background-color','green');
}
return data;
}
[/code]
but obviously that doesn't work or I wouldnt be posting here :P Just hope it makes it clear what i am trying to do?
[code]
"mRender": function(data,type,full) {
if( full.team_colour == 'green' )
{
$(this).parents('td').css('background-color','green');
}
return data;
}
[/code]
but obviously that doesn't work or I wouldnt be posting here :P Just hope it makes it clear what i am trying to do?
This discussion has been closed.
Replies
You don't - mRender is a text rendering method only and not suitable for working with the DOM. If you want to manipulate DOM elements then there is fnCreatedCell .
Not yet quite happy with the interaction, but I want to keep the DOM nodes away from mRender since deferred rendering can mean the DOM nodes don't exist when the rendering function is called.
Allan
$(nTd).parseNumber({format:"#,###.00", locale:"us"}); wont work unless I have access to TD.
Allan