I would like to know how can i export the contents of an Observable Array to an excel file, it could csv file as well. once my array is filled.. i enable a button on the screen when i click on it, i want to export that from the array.
Here is my code:
self.obtenerEmpleadosAlerta = function () {
var idNomina = $("#IDCalendarioNomina").val();
if (idNomina != "") {
var url = pathApi + "apinomina/obtenerListaEmpleadosAlerta/" + idNomina;
self.listaEmpleadosAlerta.removeAll();
disableBottonForm("frmCalendarioNomina", "btnConsultar", "lGenerarNomina");
$.getJSON(url)
.done(function (data) {
if (data["estatus"]) {
enableBottonForm("frmCalendarioNomina", "btnAlertaEmpleados", "lGenerarNomina");
$.each(data["resultado"], function (key, item) {
item.Fecha = toShortDateString(item.Fecha);
self.listaEmpleadosAlerta.push(item);
});
} else {
mostrarToastr(data["mensaje"], "E");
}
}).fail(function (d) {
enableBottonForm("frmCalendarioNomina", "btnConsultar", "lGenerarNomina");
mostrarToastr(d.responseText, "E");
});
}
}