Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
proyecto-estandar
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
Israel Gutierrez Salazar
proyecto-estandar
Commits
79700058
Commit
79700058
authored
Jan 10, 2018
by
Alonso Moreno Postigo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EDIT] Arreglado bug del datatable al realizar acciones por fila
parent
0b9ad4fa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
15 deletions
+38
-15
PersonaSqlserverDAO.java
src/java/demojsoncrud/sqlserverdao/PersonaSqlserverDAO.java
+0
-0
persona.js
web/js/pages/persona.js
+38
-15
No files found.
src/java/demojsoncrud/sqlserverdao/PersonaSqlserverDAO.java
View file @
79700058
web/js/pages/persona.js
View file @
79700058
...
...
@@ -36,7 +36,8 @@ function listarPersonaTest() {
beforeSend
:
function
(
xhr
)
{
// console.log('Antes de...');
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
console
.
log
(
data
);
// console.log(data);
// console.log("listadoTest");
},
complete
:
function
(
jqXHR
,
textStatus
)
{
// console.log('Siempre ejecutará esta función');
}
...
...
@@ -87,6 +88,8 @@ function registrarPersona() {
var
status
=
data
.
status
;
if
(
status
)
{
imprimirAlerta
(
'Correcto!'
,
data
.
message
,
'success'
);
var
table
=
$
(
'#tabla_persona'
).
DataTable
();
table
.
ajax
.
reload
();
recargarTabla
();
$
(
'#modal_registrar_persona'
).
modal
(
'hide'
);
}
else
{
...
...
@@ -184,6 +187,12 @@ function listarPersona() {
searching
:
false
,
bLengthChange
:
false
,
bFilter
:
false
,
aaSorting
:
[],
ordering
:
false
,
scrollX
:
false
,
ScrollCollapse
:
true
,
columns
:
[
{
data
:
"item"
},
{
data
:
"dni"
},
...
...
@@ -210,13 +219,25 @@ function listarPersona() {
}
}
],
"fnRowCallBack"
:
function
(
row
,
data
,
displayIndex
,
displayIndexFull
)
{
}
fnRowCallback
:
function
(
row
,
data
,
displayIndex
,
displayIndexFull
)
{
},
fnPreDrawCallback
:
function
(
settings
)
{
},
fnDrawCallback
:
function
(
settings
)
{
},
createdRow
:
function
(
row
,
data
,
dataIndex
)
{
},
initComplete
:
function
(
settings
,
json
)
{
}
});
}
$
(
'#tabla_persona tbody'
).
on
(
'click'
,
'.editarPersona'
,
function
()
{
var
data_row
=
tabla_persona
.
row
(
$
(
this
).
parents
(
'tr'
)).
data
();
$
(
'#tabla_persona tbody'
).
on
(
'click'
,
'.editarPersona'
,
function
()
{
var
data_row
=
$
(
'#tabla_persona'
).
DataTable
()
.
row
(
$
(
this
).
parents
(
'tr'
)).
data
();
console
.
log
(
data_row
);
codigoPersona
=
''
;
$
(
'#txt_numero_documento_editar'
).
val
(
data_row
.
dni
);
...
...
@@ -225,15 +246,16 @@ function listarPersona() {
$
(
'#txt_edad_editar'
).
val
(
data_row
.
edad
);
$
(
'#txt_correo_editar'
).
val
(
data_row
.
correo
);
codigoPersona
=
data_row
.
codigo
;
});
});
$
(
'#tabla_persona tbody'
).
on
(
'click'
,
'.desactivarPersona'
,
function
()
{
var
data_row
=
tabla_persona
.
row
(
$
(
this
).
parents
(
'tr'
)).
data
();
$
(
'#tabla_persona tbody'
).
on
(
'click'
,
'.desactivarPersona'
,
function
()
{
var
data_row
=
$
(
'#tabla_persona'
).
DataTable
().
row
(
$
(
this
).
parents
(
'tr'
)).
data
();
var
json
=
{
codigo
:
data_row
.
codigo
};
alert
(
data_row
.
codigo
);
console
.
log
(
data_row
.
codigo
);
swal
({
title
:
"¿Estás seguro?"
,
text
:
"¿Desea desactivar a "
+
data_row
.
apellidos
+
", "
+
data_row
.
nombres
+
" ?"
,
...
...
@@ -269,14 +291,16 @@ function listarPersona() {
}
});
});
});
$
(
'#tabla_persona tbody'
).
on
(
'click'
,
'.activarPersona'
,
function
()
{
var
data_row
=
tabla_persona
.
row
(
$
(
this
).
parents
(
'tr'
)).
data
();
$
(
'#tabla_persona tbody'
).
on
(
'click'
,
'.activarPersona'
,
function
()
{
var
data_row
=
$
(
'#tabla_persona'
).
DataTable
().
row
(
$
(
this
).
parents
(
'tr'
)).
data
();
var
json
=
{
codigo
:
data_row
.
codigo
};
console
.
log
(
data_row
.
codigo
);
alert
(
data_row
.
codigo
);
swal
({
title
:
"¿Estás seguro?"
,
text
:
"¿Desea activar a "
+
data_row
.
apellidos
+
", "
+
data_row
.
nombres
+
" ?"
,
...
...
@@ -311,9 +335,7 @@ function listarPersona() {
});
}
});
});
}
});
function
initInputs
()
{
...
...
@@ -352,6 +374,7 @@ function imprimirAlerta(title, text, type) {
}
function
recargarTabla
()
{
$
(
'#tabla_persona'
).
DataTable
().
destroy
();
listarPersona
();
}
...
...
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