Hola Amigos, por favorrrrrrrr necesito de su gran ayuda, el problema que tengo es el siguiente:
estoy implementando el JQGRID usando JSON pero al momento de correo el programa no muestra informacion alguna y lo peor de todo es que realizo el DEBUG con eclipse y no me muestra error alguno.
miren esta es mi JSP
RegistrarFichaTecnica.jsp que contiene el JQGRID en el cual invoco al
Datos_RegistrarFichaTecnica.jsp el cual contiene el JSON
Código HTML:
Ver original<script type="text/javascript"> jQuery(document).ready(function(){
jQuery("#grid").jqGrid({
url:'Datos_RegistrarFichaTecnica.jsp',
datatype: "json",
mtype: 'GET',
colNames:['codigo','A paterno', 'A materno','Nombre','F.Nac','Cargo','C.costo'],
colModel:[
{name:'PLCODI', index:'PLCODI', width:55},
{name:'PLAPEP', index:'PLAPEP', width:90},
{name:'PLAPEM', index:'PLAPEM', width:80, align:'right'},
{name:'PLNOM1', index:'PLNOM1', width:80, align:'right'},
{name:'PLFNAC', index:'PLFNAC', width:80, align:'right'},
{name:'PLCARG', index:'PLCARG', width:150 },
{name:'PLCCOS', index:'PLCCOS', width:150},
],
rowNum:10,
rowList:[10,20,30],
pager: jQuery('#gridpager'),
sortname: 'PLCODI',
viewrecords: true,
sortorder: "asc",
caption:"Wines"
}).navGrid('#gridpager');
});
esta el JSP
Datos_RegistrarFichaTecnica.jsp que contiene el JSON por favor amigos, si estoy pooniendo algo mal sean tan generosos de decirme cual es el error, muchas gracias
Código HTML:
Ver original<%
String rows=request.getParameter("rows");
String pageno=request.getParameter("page");
String cpage=pageno;
Connection connect = null;
Statement statement = null;
PreparedStatement preparedStatement = null;
ResultSet rs= null;
connect = Conexion.connect();
statement = connect.createStatement();
int count=0;
count=11;
int pageval=0;
pageval=(count/Integer.parseInt(rows));
int limitstart=0;
limitstart=(Integer.parseInt(rows)*Integer.parseInt(pageno))-Integer.parseInt(rows);
int total=count/Integer.parseInt(rows);
String totalrow=String.valueOf(total+1);
rs = statement.executeQuery("SELECT PLCODI, PLAPEP,PLAPEM, PLNOM1, \n" + "PLFNAC,PLCARG,PLCCOS \n" +"FROM SPEED400EM.TPERS \n" + "ORDER BY PLAPEP Fetch First "+rows+" Row Only " );
JSONObject responcedata=new JSONObject();
net.sf.json.JSONArray cellarray=new net.sf.json.JSONArray();
responcedata.put("total",totalrow);
responcedata.put("page",cpage);
responcedata.put("records",count);
net.sf.json.JSONArray cell=new net.sf.json.JSONArray();
net.sf.json.JSONObject cellobj=new net.sf.json.JSONObject();
int i=1;
while(rs.next())
{
cellobj.put("PLCODI",rs.getString(1));
cell.add(rs.getString(1));
cell.add(rs.getString(2));
cell.add(rs.getString(3));
cell.add(rs.getString(4));
cell.add(rs.getString(5));
cell.add(rs.getString(6));
cell.add(rs.getString(7));
cellobj.put("cell",cell);
cell.clear();
cellarray.add(cellobj);
i++;
}
responcedata.put("rows",cellarray);
out.println(responcedata);
%>