How can i do multi columns render ?
How can i do multi columns render ?
ziv@kpmbro.com
Posts: 73Questions: 28Answers: 4
in DataTables
HI
I got this column render code in my table
'aoColumnDefs': [{
'targets': 0,
'searchable': false,
'orderable': false,
'className': 'dt-body-center',
'render': function(data, type, full, meta) {
return '<input type="checkbox" name="id[]" value="' + $('<div/>').text(data).html() + '">';
},
}
]
and now i want to do a different rendering to a different columns(target), how can i do that?
i tried this
'aoColumnDefs': [{
'targets': 0,
'searchable': false,
'orderable': false,
'className': 'dt-body-center',
'render': function(data, type, full, meta) {
return '<input type="checkbox" name="id[]" value="' + $('<div/>').text(data).html() + '">';
},{
'targets': 3,
'searchable': false,
'orderable': false,
'className': 'dt-body-center',
'render': function(data, type, full, meta) {
return '<input value="test">';
},
}
]
but it doesnt work
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What you have above should work as far as I can tell. If you link to a page showing the issue I'd be happy to take a look at it.
Allan