Solucionado el boton nuevo

This commit is contained in:
Jaime Jimenez
2023-09-05 21:02:36 +02:00
parent 1cce675f79
commit 9b1f2aee80
2 changed files with 28 additions and 25 deletions

View File

@ -1,7 +1,9 @@
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
@ -9,24 +11,22 @@
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="tarifaEnvioForm" method="post" action="<?= $formAction ?>">
<form id="tarifaEnvioForm" class="card-body" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/tarifas/envios/_tarifaEnvioFormItems") ?>
</div><!-- /.card-body -->
<div class="pt-4">
<input type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("tarifaEnvioList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
</div><!-- /.card-footer -->
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/tarifas/envios/_tarifaEnvioFormItems") ?>
<div class="pt-4">
<input type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("tarifaEnvioList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
</div>
</form>
</div><!-- //.card -->
</div><!-- //.card -->
</div><!--//.col -->
<?php if(str_contains($formAction, 'edit')): ?>
@ -426,8 +426,8 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
searching: true,
paging: true,
info: false,
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
//dom: 'lBfrtip',
//dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
dom: 'Brtip',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfTarifasEnvioPrecios') ?>',
data: function ( d ) {
@ -482,9 +482,9 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
initComplete: function () {
new $.fn.dataTable.Buttons(theTable2, {
name: 'test2',
name: 'btn_new',
buttons: [{
className: 'btn btn-primary float-end me-sm-3 me-1',
className: 'btn btn-primary float-end',
extend: "createInline",
editor: editor2,
formOptions: {
@ -495,12 +495,14 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
}]
});
theTable2.buttons('test2', null)
.container()
.insertBefore('.dataTables_length');
}
var $newbtncontainer = $("<div style='float: right;'></div>");
$("#tableOfPrecios_wrapper").prepend($newbtncontainer);
theTable2.buttons('btn_new', null)
.container()
.appendTo($newbtncontainer);
}
} );

View File

@ -12,4 +12,5 @@ table.dataTable > tbody > tr.selected > * {
table.dataTable.table-hover > tbody > tr.selected:hover > * {
box-shadow: inset 0 0 0 9999px rgba(13, 110, 253, 0.65);
}
}