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
b7f72228
Commit
b7f72228
authored
Aug 17, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agregando propiedades adicionales al makeDatatable
parent
1c7ec5c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
39 deletions
+67
-39
general.js
src/main/webapp/js/general.js
+67
-39
No files found.
src/main/webapp/js/general.js
View file @
b7f72228
...
...
@@ -285,61 +285,88 @@ function primeraLetraMayuscula(str) {
const
makeDatatable
=
(
jsonForDatatable
=
{
data
:
[],
columns
:
[],
columnDefs
:
[],
wrapsNameDatatable
:
``
,
classNameForDatatable
:
``
,
footer
:
false
})
=>
{
let
data
=
jsonForDatatable
.
data
;
let
columns
=
jsonForDatatable
.
columns
;
let
columnDefs
=
jsonForDatatable
.
columns
;
let
data
=
jsonForDatatable
.
data
;
let
columns
=
jsonForDatatable
.
columns
;
let
columnDefs
=
jsonForDatatable
.
columns
;
let
wrapsNameDatatable
=
jsonForDatatable
.
wrapsNameDatatable
;
let
nameDatatable
=
`
${
wrapsNameDatatable
}
-datatable`
;
let
classNameForDatatable
=
jsonForDatatable
.
classNameForDatatable
;
let
wrapsNameDatatable
=
jsonForDatatable
.
wrapsNameDatatable
;
let
nameDatatable
=
`
${
wrapsNameDatatable
}
-datatable`
;
let
classNameForDatatable
=
jsonForDatatable
.
classNameForDatatable
;
let
table_head
=
`
let
table_head
=
`
<table id="
${
nameDatatable
}
" class="
${
classNameForDatatable
}
" cellspacing="0" width="100%">`
;
let
table_head_th
=
`
let
table_head_th
=
`
<thead>
<tr>`
;
columns
.
forEach
((
obj
)
=>
{
let
title
=
`undefined`
;
if
(
obj
.
title
)
{
title
=
obj
.
title
;
}
else
if
(
obj
.
data
)
{
title
=
obj
.
data
;
}
table_head_th
+=
`
columns
.
forEach
((
obj
)
=>
{
let
title
=
`undefined`
;
if
(
obj
.
title
)
{
title
=
obj
.
title
;
}
else
if
(
obj
.
data
)
{
title
=
obj
.
data
;
}
table_head_th
+=
`
<th>
${
title
}
</th>`
})
table_head_th
+=
`
})
table_head_th
+=
`
</tr>
</thead>`
let
table_foot_th
=
``
;
if
(
jsonForDatatable
.
footer
)
{
table_foot_th
=
`
let
table_foot_th
=
``
;
if
(
jsonForDatatable
.
footer
)
{
table_foot_th
=
`
<tfoot>
<tr>`
;
columns
.
forEach
((
obj
)
=>
{
let
title
=
`undefined`
;
if
(
obj
.
title
)
{
title
=
obj
.
title
;
}
else
if
(
obj
.
data
)
{
title
=
obj
.
data
;
}
table_foot_th
+=
`
columns
.
forEach
((
obj
)
=>
{
let
title
=
`undefined`
;
if
(
obj
.
title
)
{
title
=
obj
.
title
;
}
else
if
(
obj
.
data
)
{
title
=
obj
.
data
;
}
table_foot_th
+=
`
<th>
${
title
}
</th>`
})
table_foot_th
+=
`
})
table_foot_th
+=
`
</tr>
</tfoot>
`
}
}
let
table_foot
=
`</table>`
let
table_foot
=
`</table>`
$
(
`#
${
wrapsNameDatatable
}
`
).
empty
().
append
(
`
${
table_head
}${
table_head_th
}${
table_foot_th
}${
table_foot
}
`
);
$
(
`#
${
nameDatatable
}
`
).
DataTable
({
data
,
columns
,
columnDefs
});
$
(
`#
${
wrapsNameDatatable
}
`
).
empty
().
append
(
`
${
table_head
}${
table_head_th
}${
table_foot_th
}${
table_foot
}
`
);
$
(
`#
${
nameDatatable
}
`
).
DataTable
({
data
,
columns
,
columnDefs
,
bSort
:
false
,
bFilter
:
false
,
aaSorting
:
[],
ordering
:
false
,
bLengthChange
:
false
,
bInfo
:
true
,
paging
:
true
,
iDisplayLength
:
20
,
bStateSave
:
false
,
autoWidth
:
false
,
responsive
:
true
,
stateSave
:
true
,
language
:
{
lengthMenu
:
"Mostrar: _MENU_"
,
zeroRecords
:
" No se encontraron resultados"
,
info
:
" Mostrando del _START_ al _END_ de un total de _TOTAL_ registros"
,
infoEmpty
:
" Mostrando 0 de 0 registros"
,
search
:
"Filtrar:"
,
loadingRecords
:
"Cargando..."
,
processing
:
'<span style="width:100%;"><img src="http://www.snacklocal.com/images/ajaxload.gif"></span>'
,
paginate
:
{
first
:
"First"
,
last
:
"Last"
,
next
:
"Siguiente"
,
previous
:
"Anterior"
}
}
});
}
\ No newline at end of file
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