Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/10/2013, 13:03
Avatar de BlinDer
BlinDer
 
Fecha de Ingreso: julio-2013
Mensajes: 52
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: Jqgrid, Java Action y Json

hola y gracias a todos por su aporte lo que tengo es esto, al correr me marca un error en el js cuando mando a llamar al grid en el caption espero me puedan ayudar de favor se los agradeceria!!

jsp

Código PHP:
<div style="float: left;">
              <
table id="projectTable"></table>
              <
div id="pagingDiv"></div>
          </
div> 

--- JS ---
Código PHP:

function tabla() {
    
jQuery("#projectTable").jqGrid({
        
url: 'Codigos.do?do=cargaGRid',
        
datatype: 'json',
        
sortable: true,
        
//datatype:'local',//para que funcione de manera local
        //contentType:'application/x-www-form-urlencoded',
        
colNames: ['id', 'codigo', 'producto', 'precio'],
        
colModel: [
            {
name: 'id', index: 'id', width: 100},
            {
name: 'codigo', index: 'codigo', width: 100},
            {
name: 'producto', index: 'producto', width: 100},
            {
name: 'precio', index: 'precio', width: 100}
        ],
        
rowNum: 20,
        
altRows: true,
        
rowList: [20, 40, 60, 80, 100],
        
pager: "#pagingDiv",
        
sortname: 'id',
        
sortorder: 'asc',
        
rownumbers: false,
        
viewrecords: true,
        
//caption:'Activos',
        
caption: "Json Example" ///// AQUI ME ESTA MARCANDO EL ERROR "" jQuery(...).jqGrid is not a function "" ESTE ES EL ERROR 
ACTION JAVA

Código PHP:
codigodao = new CodigoDAO();
        
Gson gson = new Gson();
        
DynaActionForm frmForm = (DynaActionForm) form;
        List<
Codigo> list_b = codigodao.cargaTabla();

        
String formatoJSON = gson.toJson(list_b);
        
System.out.println("Texto en Formato JSON de los alumnos agregados:\n" + formatoJSON);
        return 
mapping.findForward("ok"); 
EL OTRO PROBLEMA ES QUE TENGO Q REGRESAR O HACIA DONDE LO TENGO Q REGRESAR!!!!!!
espero me puedan ayudar para que pueda resolver este problema y gracias a TODOS POR SU TIEMPO