Use datatables
to list data brought from a DB but I need to insert a select (drop-down list) in one column of the rows try this way but it did not work.
var users = $('#users').DataTable(
{});
$.ajax({
url: 'users',
type: 'POST'
})
.done(function(answer) {
var result= $.parseJSON(answer);
for (var i = result.length - 1; i >= 0; i--)
{
.row.add([
result[i].id,
result[i].nombre,
result[i].apellido,
'<select><option>-- Seleccione --</option></selec>',
'<a class="btn-floating btn-small waves-effect waves-light red hoverable"><i class="material-icons">content_paste</i></a>'
])
.draw()
.node();
.fail(function() {
console.log("error");
});
How could I fix it?