Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Multiples Subgrids jqgrid

Estas en el tema de Multiples Subgrids jqgrid en el foro de Frameworks JS en Foros del Web. Que tal, buenas a todos!! Tengo un problema, quiero agregar multiples subgrids a un grid generado con JQGrid, es decir tener tres niveles 1 Grid ...
  #1 (permalink)  
Antiguo 19/07/2012, 11:03
Avatar de charly_vc  
Fecha de Ingreso: enero-2012
Ubicación: GDL
Mensajes: 31
Antigüedad: 12 años, 3 meses
Puntos: 1
Multiples Subgrids jqgrid

Que tal, buenas a todos!!

Tengo un problema, quiero agregar multiples subgrids a un grid generado con JQGrid, es decir tener tres niveles

1 Grid
1.1 Subgrid 1
1.1.1 Subgrid 2

La cosa es que el primer subgrid si me funciona pero el subgrid 2 que debe de ser hijo del subgrid 1 me aparece en blanco. imagen de como me lo muestra:




una parte de mi codigo es el siguiente:

Código Javascript:
Ver original
  1. subGrid: true,
  2.                 subGridOptions: {
  3.         "plusicon"  : "ui-icon-triangle-1-e",
  4.         "minusicon" : "ui-icon-triangle-1-s",
  5.         "openicon"  : "ui-icon-arrowreturn-1-e",
  6.         // load the subgrid data only once
  7.         // and the just show/hide
  8.         "reloadOnExpand" : false,
  9.         // select the row when the expand column is clicked
  10.         "selectOnExpand" : true
  11.     },
  12.                 subGridRowExpanded: function(subgrid_id, row_id) {
  13.                     var subgrid_table_id, pager_id;
  14.                     subgrid_table_id = subgrid_id+"_t";
  15.                     pager_id = "p_"+subgrid_table_id;
  16.                     $j_6("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
  17.                     $j_6("#"+subgrid_table_id).jqGrid({
  18.                         url:"grids/tdoctosDatosGrid.php?referencia="+row_id,
  19.                         datatype: "json",
  20.                         colNames: ['ref_id','ID','Tipo de Documento'],
  21.                         colModel: [
  22.                             {name:"ref_id",hidden: true,index:"ref_id",width:50, key: true},
  23.                             {name:"id",index:"id",width:50},
  24.                             {name:"nombre",index:"nombre",width:650},
  25.                         ],
  26.                         rowNum:20,
  27.                         pager: pager_id,
  28.                         sortname: 'id',
  29.                         sortorder: "asc",
  30.                         loadError : function(xhr, st, str){alert("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);},
  31.                         height: '100%',
  32.                         //Inicia Subgrid de archivos
  33.                        
  34.                         subGrid: true,
  35.                         subGridOptions: {
  36.                             "plusicon"  : "ui-icon-triangle-1-e",
  37.                             "minusicon" : "ui-icon-triangle-1-s",
  38.                             "openicon"  : "ui-icon-arrowreturn-1-e",
  39.                             // load the subgrid data only once
  40.                             // and the just show/hide
  41.                             "reloadOnExpand" : false,
  42.                             // select the row when the expand column is clicked
  43.                             "selectOnExpand" : true
  44.                         },
  45.                         subGridRowExpanded: function(subgrid_id2, row_id2) {
  46.                             subgrid_id2 = subgrid_id2.replace("|","");
  47.                             var arr = row_id2.split('\|');
  48.                             var subgrid_table_id, pager_id;
  49.                             subgrid_table_id = subgrid_id2+"_t2";
  50.                            
  51.                             pager_id = "p2_"+subgrid_table_id;
  52.                             $j_6("#"+subgrid_id2).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");
  53.                             $j_6("#"+subgrid_table_id).jqGrid({
  54.                                 //url:"grids/doctosExpDatosGrid.php?tdocto_exp="+arr[1]+"&referencia="+arr[0],
  55.                                 url:"grids/doctosExpDatosGrid.php",
  56.                                 datatype: "json",
  57.                                 colNames: ['Referencia','Tipo de Documento','ID','Nombre Archivo','Nombre Documento','Fecha Documento'],
  58.                                 colModel: [
  59.                                     {name:"referencia", index:"referencia", width:150},
  60.                                     {name:"tdocto_exp", index:"tdocto_exp", width:150},
  61.                                     {name:"iddocto", index:"iddocto", width:150},
  62.                                     {name:"nombre_archivo", index:"nombre_archivo", width:200},
  63.                                     {name:"nombre_docto", index:"nombre_docto", width:200},
  64.                                     {name:"fecha_docto", index:"fecha_docto", width:150},
  65.                                 ],
  66.                                 rowNum:20,
  67.                                 pager: pager_id,
  68.                                 sortname: 'fecha_docto',
  69.                                 sortorder: "asc",
  70.                                 loadError : function(xhr, st, str){alert("Type: "+st+"; Response: "+ xhr.status + " "+xhr.statusText);},
  71.                                 height: '100%'
  72.                             });
  73.                             $j_6("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:false})
  74.                         }
  75.                         //Termina Subgrid de archivos
  76.    
  77.                     });
  78.         $j_6("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit:false,add:false,del:false})
  79.     }

Alguien me podria ayudar a ver en que parte tengo el error.

Gracias de antemano.

Última edición por charly_vc; 20/04/2015 a las 09:29 Razón: Solo es una prueba de edicion

Etiquetas: jqgrid, múltiple, subgrid
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:21.