mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
realizada la lista
This commit is contained in:
@ -0,0 +1,69 @@
|
||||
class listServiciosAcabado{
|
||||
|
||||
constructor(){}
|
||||
|
||||
init(){
|
||||
|
||||
this.table = $('#tableOfServiciosAcabado');
|
||||
|
||||
this.datatableColumns = [
|
||||
{ data: 'id', searchable: true, sortable: true, width: "10%" },
|
||||
{ data: 'nombre', searchable: true, sortable: true, width: "40%" },
|
||||
{ data: 'acabado_cubierta', sortable: true, width: "10%", render: this.#renderBoolCell.bind(this) },
|
||||
{ data: 'acabado_sobrecubierta', sortable: false, width: "10%", render: this.#renderBoolCell.bind(this) },
|
||||
{ data: 'mostrar_en_presupuesto_cliente', searchable: false, sortable: true, width: "10%", render: this.#renderBoolCell.bind(this) },
|
||||
{ data: 'user_updated', searchable: true, sortable: true },
|
||||
{ data: 'updated_at', searchable: false, sortable: true },
|
||||
{
|
||||
data: 'action', searchable: false, sortable: false, width: "10%", render: this.#renderActionCell.bind(this)
|
||||
},
|
||||
]
|
||||
|
||||
this.initDatatableTareas();
|
||||
}
|
||||
|
||||
initDatatableTareas() {
|
||||
|
||||
this.datatableTareas = this.table.DataTable({
|
||||
processing: true,
|
||||
//paging: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
responsive : true,
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/serviciosacabado/datatable'
|
||||
});
|
||||
}
|
||||
|
||||
#renderActionCell(d, t) {
|
||||
|
||||
let cell = `<div class="d-flex justify-content-start align-items-center gap-1">
|
||||
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${d.id}"></i></a></span>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete} mx-2" data-id="${d.id}"></i></a>
|
||||
</div>`
|
||||
return cell;
|
||||
}
|
||||
|
||||
#renderBoolCell(d, t) {
|
||||
|
||||
let cell = d == 1 ? '<i class="ti ti-check"></i>' : '';
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function() {
|
||||
new listServiciosAcabado().init();
|
||||
})
|
||||
|
||||
export default listServiciosAcabado;
|
||||
Reference in New Issue
Block a user