Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

mRender return object doesnt work ! why ?

$
0
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
{
      
        'bSortable': false,
        'aTargets': [0],
        'mRender': function (data, type, row) {
          return '<input type="checkbox" name="selectedbx[]" class="newcheckboxes" value="' + data + '">';
        }
}
 


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.
{
      
        'bSortable': false,
        'aTargets': [0],
        'mRender': function (data, type, row) {
          return $("<input/>").attr({
            name: "selectedbx[]",
            value: data,
            type: "checkbox"
          }).addClass('newcheckboxes');
        }
}
 

Viewing all articles
Browse latest Browse all 1816

Trending Articles