Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Asistencia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
Asistencia
Commits
1055284d
Commit
1055284d
authored
Aug 28, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arreglando datatable
parent
b9f72db6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
54 deletions
+55
-54
general.js
src/main/webapp/js/general.js
+51
-47
comparativo_proyeccion_policias.js
src/main/webapp/js/pages/comparativo_proyeccion_policias.js
+4
-6
comparativoProyeccionPolicias.jsp
src/main/webapp/vistas/comparativoProyeccionPolicias.jsp
+0
-1
No files found.
src/main/webapp/js/general.js
View file @
1055284d
...
@@ -15,7 +15,7 @@ const ajaxModal = axios.create({
...
@@ -15,7 +15,7 @@ const ajaxModal = axios.create({
baseURL
:
`http://localhost:7070/Asistencia/vistas/modals/`
baseURL
:
`http://localhost:7070/Asistencia/vistas/modals/`
});
});
//<editor-fold>
//<editor-fold> MODULO DE POLICIAS
//<editor-fold> MODULO DE POLICIAS
const
URI_TIPOROL_POLICIA
=
"tipoRolPolicias"
;
const
URI_TIPOROL_POLICIA
=
"tipoRolPolicias"
;
const
URI_FRECUENCIA_ROL_POLICIA
=
"frecuenciaRolPolicias"
;
const
URI_FRECUENCIA_ROL_POLICIA
=
"frecuenciaRolPolicias"
;
...
@@ -35,7 +35,6 @@ const URI_POLICIA_PROYECTADO_COMPARATIVO = "proyectadoComparativo";
...
@@ -35,7 +35,6 @@ const URI_POLICIA_PROYECTADO_COMPARATIVO = "proyectadoComparativo";
//</editor-fold>
//</editor-fold>
$
.
extend
(
$
.
fn
.
dataTable
.
defaults
,
{
$
.
extend
(
$
.
fn
.
dataTable
.
defaults
,
{
bSort
:
false
,
bSort
:
false
,
bFilter
:
false
,
bFilter
:
false
,
...
@@ -296,31 +295,48 @@ function primeraLetraMayuscula(str) {
...
@@ -296,31 +295,48 @@ function primeraLetraMayuscula(str) {
const
makeDatatable
=
(
jsonForDatatable
=
{
const
makeDatatable
=
(
data
:
[],
wrapName
=
``
,
forDatatable
=
{
data
:
[],
columns
:
[],
columns
:
[],
columnDefs
:
[],
wrapsNameDatatable
:
``
,
classNameForDatatable
:
``
,
footerFilter
:
false
,
footerFilter
:
false
,
highlighting
:
true
footer
:
false
})
=>
{
},
let
data
=
jsonForDatatable
.
data
;
className
=
``
,
let
columns
=
jsonForDatatable
.
columns
;
)
=>
{
let
columnDefs
=
jsonForDatatable
.
columns
;
if
(
!
wrapName
)
{
let
wrapsNameDatatable
=
jsonForDatatable
.
wrapsNameDatatable
return
{
let
nameDatatable
=
`
${
wrapsNameDatatable
}
-datatable`
message
:
`{wrapName} is empty`
,
let
classNameForDatatable
=
jsonForDatatable
.
classNameForDatatable
status
:
false
}
let
highlighting
=
jsonForDatatable
.
highlighting
}
let
footerFilter
=
jsonForDatatable
.
footerFilter
debugger
;
if
(
forDatatable
.
data
.
length
<=
0
)
{
return
{
message
:
`{data} is empty`
,
status
:
false
}
}
if
(
forDatatable
.
columns
.
length
<=
0
)
{
return
{
message
:
`{columns} is empty`
,
status
:
false
}
}
let
nameDatatable
=
`
${
wrapName
}
-datatable`
;
// table
let
table_head
=
`
let
table_head
=
`
<table id="
${
nameDatatable
}
" class="
${
classNameForDatatable
}
table-hover" cellspacing="0" width="100%">`
;
<table id="
${
nameDatatable
}
" class="table table-hover
${
className
}
" cellspacing="0" width="100%">`
;
// headers
let
table_head_th
=
`
let
table_head_th
=
`
<thead>
<thead>
<tr>`
;
<tr>`
;
columns
.
forEach
((
obj
)
=>
{
forDatatable
.
columns
.
forEach
((
obj
)
=>
{
let
title
=
`undefined`
;
let
title
=
`undefined`
;
if
(
obj
.
title
)
{
if
(
obj
.
title
)
{
title
=
obj
.
title
;
title
=
obj
.
title
;
...
@@ -334,12 +350,13 @@ data: [],
...
@@ -334,12 +350,13 @@ data: [],
</tr>
</tr>
</thead>`
</thead>`
// footers
let
table_foot_th
=
``
;
let
table_foot_th
=
``
;
if
(
fo
oterFil
ter
)
{
if
(
fo
rDatatable
.
foo
ter
)
{
table_foot_th
=
`
table_foot_th
=
`
<tfoot>
<tfoot>
<tr>`
;
<tr>`
;
columns
.
forEach
((
obj
)
=>
{
forDatatable
.
columns
.
forEach
((
obj
)
=>
{
let
title
=
`undefined`
;
let
title
=
`undefined`
;
if
(
obj
.
title
)
{
if
(
obj
.
title
)
{
title
=
obj
.
title
;
title
=
obj
.
title
;
...
@@ -355,11 +372,13 @@ data: [],
...
@@ -355,11 +372,13 @@ data: [],
`
`
}
}
// table
let
table_foot
=
`</table>`
let
table_foot
=
`</table>`
$
(
`#
${
wrapsNameDatatable
}
`
).
empty
().
append
(
`
${
table_head
}${
table_head_th
}${
table_foot_th
}${
table_foot
}
`
);
$
(
`#
${
wrapName
}
`
).
empty
().
append
(
`
${
table_head
}${
table_head_th
}${
table_foot_th
}${
table_foot
}
`
);
if
(
footerFilter
)
{
// Setup - add a text input to each footer cell
if
(
forDatatable
.
footerFilter
)
{
// Setup - add a text input to each footer cell
$
(
`#
${
nameDatatable
}
tfoot th`
).
each
(
function
()
{
$
(
`#
${
nameDatatable
}
tfoot th`
).
each
(
function
()
{
var
title
=
$
(
this
).
text
();
var
title
=
$
(
this
).
text
();
$
(
this
).
html
(
`<input type="text" class="form-control" placeholder="
${
title
}
" />`
);
$
(
this
).
html
(
`<input type="text" class="form-control" placeholder="
${
title
}
" />`
);
...
@@ -367,18 +386,12 @@ data: [],
...
@@ -367,18 +386,12 @@ data: [],
}
}
$
(
`#
${
nameDatatable
}
`
)
$
(
`#
${
nameDatatable
}
`
)
.
DataTable
({
.
DataTable
(
forDatatable
);
data
,
columns
,
if
(
forDatatable
.
footerFilter
)
{
columnDefs
,
// DataTable
fixedColumns
:
{
leftColumns
:
1
,
rightColumns
:
1
}
});
if
(
footerFilter
)
{
// DataTable
let
table
=
$
(
`#
${
nameDatatable
}
`
).
DataTable
();
let
table
=
$
(
`#
${
nameDatatable
}
`
).
DataTable
();
// Apply the search
// Apply the search
table
.
columns
().
every
(
function
()
{
table
.
columns
().
every
(
function
()
{
var
that
=
this
;
var
that
=
this
;
...
@@ -390,22 +403,13 @@ data: [],
...
@@ -390,22 +403,13 @@ data: [],
}
}
});
});
});
});
$
(
`#
${
wrapsNameDatatable
}
.dataTables_scrollBody`
).
appendTo
(
`#
${
wrapsNameDatatable
}
.dataTables_scroll`
);
}
if
(
highlighting
)
{
$
(
`#
${
wrapName
}
.dataTables_scrollBody`
).
appendTo
(
`#
${
wrapName
}
.dataTables_scroll`
);
let
table
=
$
(
`#
${
nameDatatable
}
`
).
DataTable
();
$
(
`#
${
nameDatatable
}
tbody`
)
.
on
(
'mouseenter'
,
'td'
,
function
()
{
let
colIdx
=
table
.
cell
(
this
).
index
().
column
;
$
(
table
.
cells
().
nodes
()).
removeClass
(
'highlight'
);
$
(
table
.
column
(
colIdx
).
nodes
()).
addClass
(
'highlight'
);
});
}
}
return
Promise
.
resolve
({
return
Promise
.
resolve
({
datatable
:
$
(
`#
${
nameDatatable
}
`
),
datatable
:
$
(
`#
${
nameDatatable
}
`
),
container
:
$
(
`#
${
wrap
sNameDatatabl
e
}
`
)
container
:
$
(
`#
${
wrap
Nam
e
}
`
)
});
});
}
}
...
...
src/main/webapp/js/pages/comparativo_proyeccion_policias.js
View file @
1055284d
...
@@ -132,17 +132,15 @@ function verReporte(objParams = {}) {
...
@@ -132,17 +132,15 @@ function verReporte(objParams = {}) {
let
wrapsNameDatatable
=
`divDatatable`
;
let
wrapsNameDatatable
=
`divDatatable`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
footer
=
false
;
makeDatatable
(
makeDatatable
(
wrapsNameDatatable
,
{
{
data
:
response
.
data
,
data
:
response
.
data
,
columns
,
columns
,
columnDefs
,
columnDefs
,
wrapsNameDatatable
,
classNameForDatatable
,
},
footer
classNameForDatatable
}
)
)
}
}
);
);
...
...
src/main/webapp/vistas/comparativoProyeccionPolicias.jsp
View file @
1055284d
...
@@ -65,7 +65,6 @@
...
@@ -65,7 +65,6 @@
<
%@
include
file=
"templates/footer-body.jsp"
%
>
<
%@
include
file=
"templates/footer-body.jsp"
%
>
<!--js de la pagina-->
<!--js de la pagina-->
<script
src=
"../plantilla/assets/js/plugins/tables/datatables/datatables.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/plugins/ui/moment/moment.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/plugins/ui/moment/moment.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/plugins/pickers/daterangepicker.js"
></script>
<script
src=
"../plantilla/assets/js/plugins/pickers/daterangepicker.js"
></script>
<script
src=
"../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"
></script>
<script
src=
"../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment