How can i do multi columns render ?
How can i do multi columns render ?
![ziv@kpmbro.com](https://secure.gravatar.com/avatar/bb96751351d8c7bcde8640bacc31e97f/?default=https%3A%2F%2Fvanillicon.com%2Fbb96751351d8c7bcde8640bacc31e97f_200.png&rating=g&size=120)
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