Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2013, 14:38
Avatar de shake2427
shake2427
 
Fecha de Ingreso: julio-2011
Mensajes: 116
Antigüedad: 12 años, 10 meses
Puntos: 3
problema con jqgrid

buenos dias estoy intentando generar un grid con esta libreria
http://www.trirand.net/demo/php/jqgrid/


tengo el siguiente codigo llamando un procedure, el grid me carga toda la informacion para dar click sobre el nombre no me los organiza, ni me hace la paginacion.

pero al poner la consulta como tal, sin procedure, si me realiza todo correctamente


Código PHP:
Ver original
  1. <?php
  2. require_once '../class/class.conection.php';
  3.         $classDB = new conexion;
  4.         $DB = $classDB->conexionBD();  
  5. // include the jqGrid Class
  6. require_once "../class/jqGrid.php";
  7. // include the driver class
  8. require_once "../class/jqGridPdo.php";
  9. // Connection to the server
  10. // Tell the db that we use utf-8
  11. $DB->query("SET NAMES utf8");
  12.  
  13. // Create the jqGrid instance
  14. $grid = new jqGridRender($DB);
  15. // Write the SQL Query
  16. $grid->SelectCommand = 'call negocio2();';
  17. // Set output format to json
  18. $grid->dataType = 'json';
  19. // Let the grid create the model
  20. $grid->setColModel();
  21. // Set the url from where we obtain the data
  22. $grid->setUrl('../grid/grid_negocio.php');
  23. // Set some grid options
  24. $grid->setGridOptions(array(
  25.     "rowNum"=>10,
  26.     "rowList"=>array(10,20,30),
  27.     "sortname"=>"Identificacion"
  28. ));
  29.  
  30.  
  31.  
  32. // Change some property of the field(s)
  33. $grid->setColProperty("fechamod", array(
  34.     "formatter"=>"date",
  35.     "formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"m/d/Y")
  36.     )
  37. );
  38. //Date Settings
  39. $grid->datearray = array('fechamod');
  40. $grid->SetUserDate('m/d/Y');
  41. $grid->SetUserTime('m/d/Y');
  42.  
  43. $grid->setColProperty("Nombre", array("width"=>"200"));
  44. // Enable navigator
  45. $grid->navigator = true;
  46. // Enable search
  47. $grid->setNavOptions('navigator', array("excel"=>false,"add"=>false,"edit"=>false,"del"=>false,"view"=>false));
  48. // Activate single search
  49. $grid->setNavOptions('search',array("multipleSearch"=>false));
  50. // Enjoy
  51. $grid->renderGrid('#grid','#pager',true, null, null, true,true);
  52. $conn = null;
  53. ?>


formulario

Código PHP:
Ver original
  1. <?
  2.     //seguridad pagina
  3.     include_once('../includes/seguridadapp.php');
  4. ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9. <title>Movistar Moviles - Negocios</title>
  10. <!-- archivos incluidos--->
  11. <? include_once('../includes/files_includes.php') ?>
  12.  
  13.     <link rel="stylesheet" type="text/css" media="screen" href="../css/redmond/jquery-ui-1.10.3.custom.css" />
  14.     <link rel="stylesheet" type="text/css" media="screen" href="../css/ui.jqgrid.css" />
  15.  
  16.  
  17.     <script src="../js/jquery.js" type="text/javascript"></script>
  18.     <script src="../js/grid.locale-es.js" type="text/javascript"></script>
  19.     <script type="text/javascript">
  20.     $.jgrid.no_legacy_api = false;
  21.     $.jgrid.useJSON = false;
  22.     </script>
  23.     <script src="../js/jquery.jqGrid.min.js" type="text/javascript"></script>
  24.     <script src="../js/jquery-ui-1.9.2.custom.min" type="text/javascript"></script>
  25.  
  26.  
  27. </head>
  28. <body>
  29. <!-- tabla principal--->
  30. <table cellpadding="0" cellspacing="0" width="100%" border="0">
  31.     <tr>
  32.         <td>
  33. <table cellpadding="0" cellspacing="0" width="100%">
  34.     <tr>
  35.         <td>
  36.         <? include_once('../includes/header.php')?>
  37.         <? include_once('../includes/navigation.php')?>
  38.         </td>
  39.     </tr>
  40.         <tr>
  41.             <td>
  42. <table cellpadding="0" cellspacing="0" width="98%" align="center" border="0">
  43.     <tr>
  44.         <td valign="top">
  45. <!--tabla de opciones de busquedad--->      
  46. <table cellpadding="5" cellspacing="0" width="100%" border="0" class="lettergeneral" style="border-bottom:1px dashed #CCCCCC">
  47. <? if(isset($varresponsefechasbqd)){ ?>
  48.     <tr>
  49.         <td colspan="6" class="msjerror">
  50.         <? echo $varresponsefechasbqd ?>
  51.         </td>
  52.     </tr>
  53. <? }?>  
  54.     <!--    <tr>
  55.             <td>
  56.             Buscar Por :
  57.             </td>
  58.                 <td>
  59.                 <select name="" id="" class="fieldselectsearch">
  60.                     <option>Cualquier Campo</option>
  61.                     <option>Fecha de venta</option>
  62.                     <option>Identificaci&oacute;n del cliente</option>
  63.                     <option>Nombre del Cliente</option>
  64.                     <option>Numero Icc</option>
  65.                     <option>Num Celular</option>
  66.                     <option>Nombre Distribuidor</option>
  67.                     <option>Total Recarga</option>
  68.                 </select>    
  69.                 </td>
  70.                     <td>
  71.                     Contiene :
  72.                     </td>
  73.                         <td>
  74.                 <select name="" id="" class="fieldselectsearch">
  75.                     <option>Igual</option>
  76.                     <option>No igual a</option>
  77.                     <option>Es menor que </option>
  78.                     <option>Menor igual que</option>
  79.                     <option>Mayor Igual que</option>
  80.                     <option>Como</option>
  81.                     <option>Inicia con</option>
  82.                     <option>Finaliza con</option>
  83.                     <option>Contiene</option>
  84.                 </select>  
  85.                         </td>
  86.                             <td>
  87.                             <input type="text" name="" id="" class="fieldtextsearch" />
  88.                             </td>
  89.                                 <td>
  90.                     <input type="button" name="" id="" value="Buscar" class="fieldbuttonsearch" />
  91.                                 </td>
  92.         </tr>-->
  93.    
  94. <form name="formbqdfehcas" id="formbqdfehcas" method="get" action="#">
  95.         <tr>
  96.             <td>
  97.             Inicial:
  98.             </td>
  99.                 <td>
  100.                 <input type="text" name="searchfechainicial" id="searchfechainicial" class="fieldtextsearch calendariojqry" readonly="readonly" value="<? echo $_GET['searchfechainicial'] ?>" />
  101.                 </td>
  102.                     <td>
  103.                     Final:
  104.                     </td>
  105.                         <td>
  106.                           <input type="text" name="searchfechafinal" id="searchfechafinal" class="fieldtextsearch calendariojqry"  readonly="readonly" value="<? echo $_GET['searchfechafinal'] ?>" />
  107.                         </td>
  108.                             <td>
  109.                             <input type="submit" name="bqd_enviarfechas" id="bqd_enviarfechas" value="Buscar" class="fieldbuttonsearch" />
  110.                             </td>
  111.         </tr>
  112. </form>        
  113. </table>
  114. <!--tabla de opciones de busquedad--->      
  115.         </td>
  116.     </tr>
  117.         <tr>   
  118.             <td class="titulogeneralpag">
  119.             negocios
  120.             </td>
  121.         </tr>  
  122.             <tr>
  123.                 <td align="right" class="lettergeneral">
  124.                
  125.                 Exportar :
  126.  
  127. <a href="javascript:window.print()"  ><img src="../img/print.png" title="Imprimir" style="border:0px; width:32px; height:32;" /></a>
  128.                  </td>
  129.             </tr>  
  130.                     <tr>
  131.                         <td align="center">
  132.                             <?php include ("../grid/grid_negocio.php");?>
  133.                         </td>  
  134.                     </tr>
  135.                    
  136.             <td>
  137.              <? include_once('../includes/footer.php')?>
  138.             </td>
  139. </table>
  140.         </td>
  141.     </tr>
  142. </table>
  143. <!-- termina tabla principal--->  
  144. </body>
  145. </html>