mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/datatable-error-presupuesto' into 'dev/presu_cliente_v2'
default sort error presupuestos datatable,set pagination to 50 and add page selector See merge request jjimenez/safekat!356
This commit is contained in:
@ -58,9 +58,9 @@ class ConfigErrores extends BaseResourceController
|
|||||||
public function get_error_presupuesto(int $error_presupuesto_id)
|
public function get_error_presupuesto(int $error_presupuesto_id)
|
||||||
{
|
{
|
||||||
$data = $this->errorPresupuestoModel->getErrorPresupuestoForm($error_presupuesto_id);
|
$data = $this->errorPresupuestoModel->getErrorPresupuestoForm($error_presupuesto_id);
|
||||||
if(isset($data[0])){
|
if (isset($data[0])) {
|
||||||
return $this->response->setJSON(["data" => $data[0]]);
|
return $this->response->setJSON(["data" => $data[0]]);
|
||||||
}else{
|
} else {
|
||||||
return $this->response->setJSON(["data" => []]);
|
return $this->response->setJSON(["data" => []]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,9 +73,9 @@ class ConfigErrores extends BaseResourceController
|
|||||||
|
|
||||||
public function datatable()
|
public function datatable()
|
||||||
{
|
{
|
||||||
$query = $this->errorPresupuestoModel->getQueryDatatable();
|
$query = $this->errorPresupuestoModel->getQueryDatatable()->orderBy("created_at", "DESC");
|
||||||
return DataTable::of($query)
|
return DataTable::of($query)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -29,9 +29,14 @@ class ErrorPresupuestoView {
|
|||||||
init() {
|
init() {
|
||||||
this.datatable = this.datatableItem.DataTable({
|
this.datatable = this.datatableItem.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
dom: 'Brtip',
|
layout :{
|
||||||
|
topStart: 'pageLength',
|
||||||
|
topEnd: 'search',
|
||||||
|
bottomStart: 'info',
|
||||||
|
bottomEnd: 'paging'
|
||||||
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
pageLength : 50,
|
||||||
language: {
|
language: {
|
||||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user