mRender return object doesnt work ! why ?
mRender return object doesnt work ! why ?
babablacksheep
Posts: 41Questions: 23Answers: 0
I am trying to return an object in mRender function but datatable adds [object Object] string in column.
is it possible to return object ? because it can be helpful in structured coding to grab ref to object and use it later.
Works
[code]
{
'bSortable': false,
'aTargets': [0],
'mRender': function (data, type, row) {
return '';
}
}
[/code]
Doesn't work . why ?
Benefit of returning object is that I can keep its refer in structured coding so i don't have to use jquery selectors to find it again.
[code]
{
'bSortable': false,
'aTargets': [0],
'mRender': function (data, type, row) {
return $("").attr({
name: "selectedbx[]",
value: data,
type: "checkbox"
}).addClass('newcheckboxes');
}
}
[/code]
is it possible to return object ? because it can be helpful in structured coding to grab ref to object and use it later.
Works
[code]
{
'bSortable': false,
'aTargets': [0],
'mRender': function (data, type, row) {
return '';
}
}
[/code]
Doesn't work . why ?
Benefit of returning object is that I can keep its refer in structured coding so i don't have to use jquery selectors to find it again.
[code]
{
'bSortable': false,
'aTargets': [0],
'mRender': function (data, type, row) {
return $("").attr({
name: "selectedbx[]",
value: data,
type: "checkbox"
}).addClass('newcheckboxes');
}
}
[/code]
This discussion has been closed.
Replies
Allan