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
76bac4fb
Commit
76bac4fb
authored
Aug 27, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getSourceData en HandsonTable
parent
539a8d33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
29 deletions
+35
-29
proyectar_asistencia_policias.js
src/main/webapp/js/pages/proyectar_asistencia_policias.js
+35
-29
No files found.
src/main/webapp/js/pages/proyectar_asistencia_policias.js
View file @
76bac4fb
let
listaSedes
=
[];
let
handsonTable
;
// This example creates a date editor that will show MM/YYYY
const
TA_EDITOR_HORA
=
Handsontable
.
editors
.
TextEditor
.
prototype
.
extend
();
TA_EDITOR_HORA
.
prototype
.
createElements
=
function
()
{
Handsontable
.
editors
.
TextEditor
.
prototype
.
createElements
.
apply
(
this
,
arguments
);
// You need to require/import the "inputmask" library
var
im
=
new
Inputmask
(
'99:99'
);
// Create password input and update relevant properties
this
.
TEXTAREA
=
document
.
createElement
(
'input'
);
this
.
TEXTAREA
.
setAttribute
(
'type'
,
'text'
);
this
.
TEXTAREA
.
className
=
'text'
;
im
.
mask
(
this
.
TEXTAREA
);
this
.
textareaStyle
=
this
.
TEXTAREA
.
style
;
this
.
textareaStyle
.
width
=
0
;
this
.
textareaStyle
.
height
=
0
;
// Replace textarea with password input
Handsontable
.
dom
.
empty
(
this
.
TEXTAREA_PARENT
);
this
.
TEXTAREA_PARENT
.
appendChild
(
this
.
TEXTAREA
);
};
function
listarSedes
(
selectorName
)
{
ajaxWebService
.
get
(
URI_SEDES
).
then
((
result
)
=>
{
...
...
@@ -59,6 +82,8 @@ function mostrarVistaPrevia() {
})
.
forEach
(
dr
=>
{
let
obj
=
{
rol_id
:
rol
.
id
,
detallerol_id
:
dr
.
id
,
policia_dni
:
rol
.
policia_dni
,
policia_nombres
:
rol
.
policia_nombres
,
fecha_entrada
:
dr
.
fecha_entrada
,
...
...
@@ -144,7 +169,10 @@ function mostrarVistaPrevia() {
dateFormat
:
'DD/MM/YYYY'
,
readOnly
:
true
}
]
],
// afterChange: (change, source) => {
// console.log(`change= ${change}, source=${source}`);
// }
});
registrarEventoTab
();
}
...
...
@@ -167,7 +195,7 @@ function registrarEventoTab() {
var
rowIndex
=
selection
[
0
];
var
colIndex
=
selection
[
1
];
console
.
log
(
`row=
${
rowIndex
}
, col=
${
colIndex
}
`
)
//
console.log(`row=${rowIndex}, col=${colIndex}`)
//rowIndex++;
colIndex
++
;
...
...
@@ -185,34 +213,10 @@ function registrarEventoTab() {
});
}
function
guardarCambios
()
{
let
data
=
handsonTable
.
getSourceData
();
// This example creates a date editor that will show MM/YYYY
const
TA_EDITOR_HORA
=
Handsontable
.
editors
.
TextEditor
.
prototype
.
extend
();
TA_EDITOR_HORA
.
prototype
.
createElements
=
function
()
{
Handsontable
.
editors
.
TextEditor
.
prototype
.
createElements
.
apply
(
this
,
arguments
);
// You need to require/import the "inputmask" library
var
im
=
new
Inputmask
(
'99:99'
);
// Create password input and update relevant properties
this
.
TEXTAREA
=
document
.
createElement
(
'input'
);
this
.
TEXTAREA
.
setAttribute
(
'type'
,
'text'
);
this
.
TEXTAREA
.
className
=
'text'
;
im
.
mask
(
this
.
TEXTAREA
);
this
.
textareaStyle
=
this
.
TEXTAREA
.
style
;
this
.
textareaStyle
.
width
=
0
;
this
.
textareaStyle
.
height
=
0
;
// Replace textarea with password input
Handsontable
.
dom
.
empty
(
this
.
TEXTAREA_PARENT
);
this
.
TEXTAREA_PARENT
.
appendChild
(
this
.
TEXTAREA
);
};
}
...
...
@@ -246,4 +250,5 @@ $().ready(function () {
// defaultConfigDataTable();
defaultConfigHandsonTable
();
$
(
"#btnVistaPrevia"
).
click
(
mostrarVistaPrevia
);
$
(
"#btnGuardarCambios"
).
click
(
guardarCambios
);
});
\ 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