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
082e885b
Commit
082e885b
authored
Jan 10, 2018
by
Alonso Moreno Postigo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Arreglado bug al realizar acciones en la fila
parent
79700058
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
22 deletions
+28
-22
PersonaSqlserverDAO.java
src/java/demojsoncrud/sqlserverdao/PersonaSqlserverDAO.java
+4
-2
ResponseHelper.java
src/java/demojsoncrud/utils/ResponseHelper.java
+12
-11
persona.js
web/js/pages/persona.js
+12
-9
No files found.
src/java/demojsoncrud/sqlserverdao/PersonaSqlserverDAO.java
View file @
082e885b
...
...
@@ -63,7 +63,10 @@ public class PersonaSqlserverDAO implements PersonaDAO {
data
.
put
(
obj
);
}
response
.
setData
(
data
);
JSONObject
jsonData
=
new
JSONObject
();
jsonData
.
put
(
"personas"
,
data
);
response
.
setData
(
jsonData
);
response
.
setMessage
(
"Listado correcto!"
);
response
.
setStatus
(
true
);
...
...
@@ -143,7 +146,6 @@ public class PersonaSqlserverDAO implements PersonaDAO {
personaBean
.
setCorreo
(
rsListarPersona
.
getString
(
c
++));
personaBean
.
setEstado
(
rsListarPersona
.
getString
(
c
++));
JSONObject
obj
=
new
JSONObject
(
personaBean
);
obj
.
put
(
"item"
,
numeroFilas
++);
data
.
put
(
obj
);
}
...
...
src/java/demojsoncrud/utils/ResponseHelper.java
View file @
082e885b
...
...
@@ -6,6 +6,7 @@
package
demojsoncrud
.
utils
;
import
java.io.Serializable
;
import
org.json.JSONObject
;
/**
*
...
...
@@ -13,7 +14,7 @@ import java.io.Serializable;
*/
public
class
ResponseHelper
implements
Serializable
{
private
Object
data
;
private
JSON
Object
data
;
private
boolean
status
;
private
String
message
;
...
...
@@ -21,28 +22,28 @@ public class ResponseHelper implements Serializable {
}
public
boolean
isStatus
()
{
return
status
;
public
JSONObject
getData
()
{
return
data
;
}
public
void
setStatus
(
boolean
status
)
{
this
.
status
=
status
;
public
boolean
isStatus
(
)
{
return
status
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
set
Message
(
String
message
)
{
this
.
message
=
message
;
public
void
set
Data
(
JSONObject
data
)
{
this
.
data
=
data
;
}
public
Object
getData
(
)
{
return
data
;
public
void
setStatus
(
boolean
status
)
{
this
.
status
=
status
;
}
public
void
set
Data
(
Object
data
)
{
this
.
data
=
data
;
public
void
set
Message
(
String
message
)
{
this
.
message
=
message
;
}
}
web/js/pages/persona.js
View file @
082e885b
...
...
@@ -36,8 +36,13 @@ function listarPersonaTest() {
beforeSend
:
function
(
xhr
)
{
// console.log('Antes de...');
},
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
// console.log(data);
// console.log("listadoTest");
console
.
log
(
data
);
// var personas = data.data.personas;
// for (var i = 0; i < personas.length; i++) {
// var persona = personas[i];
// console.log(persona.apellidos);
// }
//// console.log("listadoTest");
},
complete
:
function
(
jqXHR
,
textStatus
)
{
// console.log('Siempre ejecutará esta función');
}
...
...
@@ -88,8 +93,8 @@ function registrarPersona() {
var
status
=
data
.
status
;
if
(
status
)
{
imprimirAlerta
(
'Correcto!'
,
data
.
message
,
'success'
);
var
table
=
$
(
'#tabla_persona'
).
DataTable
();
table
.
ajax
.
reload
();
//
var table = $('#tabla_persona').DataTable();
//
table.ajax.reload();
recargarTabla
();
$
(
'#modal_registrar_persona'
).
modal
(
'hide'
);
}
else
{
...
...
@@ -194,7 +199,7 @@ function listarPersona() {
ScrollCollapse
:
true
,
columns
:
[
{
data
:
"
item
"
},
{
data
:
"
codigo
"
},
{
data
:
"dni"
},
{
data
:
null
,
...
...
@@ -254,8 +259,7 @@ $('#tabla_persona tbody').on('click', '.desactivarPersona', function () {
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
+
" ?"
,
...
...
@@ -299,8 +303,7 @@ $('#tabla_persona tbody').on('click', '.activarPersona', function () {
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
+
" ?"
,
...
...
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