Good afternoon, I need to know how I can apply a reload
to a datatable in typescript with Angular 2,
options = {
dom: "Bfrtip",
ajax: (data, callback, settings) => {
this.servicioUsuarios.getUsuarios().subscribe(data => {
this.usuarioArray = data
console.log(this.usuarioArray);
callback({
aaData: data
})
}, e => {
this.notificaciones.notificacionError(e);
});
},
columns: [
{ data: "id" },
{ data: "login" },
{
"render":
function (data, type, row) {
return (row.nombre + ' ' + row.primerApellido + ' ' + row.segundoApellido);
}
},
{ data: "correo" },
{ data: "fechaAlta" },
],
select: true,
rowCallback: (row: Node, data: any[] | Object, index: number) => {
$('td', row).unbind('click');
$('td', row).bind('click', () => {
this.usuarioArray = data;
// $('td', row).addClass('alert alert-success');
});
return row;
}
};