Commit af90a279 by Billy Larru

[EDIT control asistencia docentes, agregando checkbox]

parent 22a93482
...@@ -63,7 +63,7 @@ function getColumns() { ...@@ -63,7 +63,7 @@ function getColumns() {
className: 'text-center' className: 'text-center'
}, },
{ {
title: `FIRMÓ SALIDA`.split(' ').join('<br>'), title: `FIRMÓ SALIDA <input type="checkbox" id="chkFirmaTodo">`,
data: `firmo_salida`, data: `firmo_salida`,
className: 'text-center', className: 'text-center',
render: (data) => { render: (data) => {
...@@ -83,7 +83,8 @@ function getColumns() { ...@@ -83,7 +83,8 @@ function getColumns() {
case "": case "":
label = "label bg-purple"; label = "label bg-purple";
contenido = "PENDIENTE"; // contenido = "PENDIENTE";
return `<input type="checkbox" class="chkFirma">`;
break; break;
} }
...@@ -244,16 +245,38 @@ function listarAsistenciaDocentes(objParams = {}){ ...@@ -244,16 +245,38 @@ function listarAsistenciaDocentes(objParams = {}){
}, },
classNameForDatatable, classNameForDatatable,
).then((nodes) => { ).then((nodes) => {
nodes.container.off(); $(".chkFirma, #chkFirmaTodo").uniform();
nodes.container.on("click", ".registrar", function () { nodes.container
.off()
.on("click", ".registrar", function () {
let data = nodes.datatable.DataTable().row($(this).parents("tr")).data(); let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
mostrarModalRegistroAsistencia(data); mostrarModalRegistroAsistencia(data);
}); })
.on("click", "#chkFirmaTodo", (e) => seleccionarCheckBoxTodo($(e.currentTarget)))
.on("click", ".chkFirma", (e) => seleccionarCheckBox());
}); });
}); });
} }
const seleccionarCheckBoxTodo = (tr) => {
if (tr.prop('checked')) {
$('.chkFirma').prop('checked', true).uniform()
} else {
$('.chkFirma').prop('checked', false).uniform()
}
}
const seleccionarCheckBox = () => {
debugger
if ($('.chkFirma:checked').length === $('.chkFirma').length) {
$('#chkFirmaTodo').prop('checked', true).uniform()
} else {
$('#chkFirmaTodo').prop('checked', false).uniform()
}
}
const aplicarFiltro = () => { const aplicarFiltro = () => {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment