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<?php
require_once '../class/class.conection.php';
$classDB = new conexion;
$DB = $classDB->conexionBD();
// include the jqGrid Class
require_once "../class/jqGrid.php";
// include the driver class
require_once "../class/jqGridPdo.php";
// Connection to the server
// Tell the db that we use utf-8
$DB->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($DB);
// Write the SQL Query
$grid->SelectCommand = 'call negocio2();';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('../grid/grid_negocio.php');
// Set some grid options
$grid->setGridOptions(array( "rowNum"=>10,
"rowList"=>array(10,20,30), "sortname"=>"Identificacion"
));
// Change some property of the field(s)
$grid->setColProperty("fechamod", array( "formatter"=>"date",
"formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"m/d/Y") )
);
//Date Settings
$grid->datearray = array('fechamod'); $grid->SetUserDate('m/d/Y');
$grid->SetUserTime('m/d/Y');
$grid->setColProperty("Nombre", array("width"=>"200")); // Enable navigator
$grid->navigator = true;
// Enable search
$grid->setNavOptions('navigator', array("excel"=>false,"add"=>false,"edit"=>false,"del"=>false,"view"=>false)); // Activate single search
$grid->setNavOptions('search',array("multipleSearch"=>false)); // Enjoy
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
$conn = null;
?>
formulario
Código PHP:
Ver original<?
//seguridad pagina
include_once('../includes/seguridadapp.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Movistar Moviles - Negocios</title>
<!-- archivos incluidos--->
<? include_once('../includes/files_includes.php') ?>
<link rel="stylesheet" type="text/css" media="screen" href="../css/redmond/jquery-ui-1.10.3.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../css/ui.jqgrid.css" />
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/grid.locale-es.js" type="text/javascript"></script>
<script type="text/javascript">
$.jgrid.no_legacy_api = false;
$.jgrid.useJSON = false;
</script>
<script src="../js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="../js/jquery-ui-1.9.2.custom.min" type="text/javascript"></script>
</head>
<body>
<!-- tabla principal--->
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<? include_once('../includes/header.php')?>
<? include_once('../includes/navigation.php')?>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="98%" align="center" border="0">
<tr>
<td valign="top">
<!--tabla de opciones de busquedad--->
<table cellpadding="5" cellspacing="0" width="100%" border="0" class="lettergeneral" style="border-bottom:1px dashed #CCCCCC">
<? if(isset($varresponsefechasbqd)){ ?> <tr>
<td colspan="6" class="msjerror">
<? echo $varresponsefechasbqd ?>
</td>
</tr>
<? }?>
<!-- <tr>
<td>
Buscar Por :
</td>
<td>
<select name="" id="" class="fieldselectsearch">
<option>Cualquier Campo</option>
<option>Fecha de venta</option>
<option>Identificación del cliente</option>
<option>Nombre del Cliente</option>
<option>Numero Icc</option>
<option>Num Celular</option>
<option>Nombre Distribuidor</option>
<option>Total Recarga</option>
</select>
</td>
<td>
Contiene :
</td>
<td>
<select name="" id="" class="fieldselectsearch">
<option>Igual</option>
<option>No igual a</option>
<option>Es menor que </option>
<option>Menor igual que</option>
<option>Mayor Igual que</option>
<option>Como</option>
<option>Inicia con</option>
<option>Finaliza con</option>
<option>Contiene</option>
</select>
</td>
<td>
<input type="text" name="" id="" class="fieldtextsearch" />
</td>
<td>
<input type="button" name="" id="" value="Buscar" class="fieldbuttonsearch" />
</td>
</tr>-->
<form name="formbqdfehcas" id="formbqdfehcas" method="get" action="#">
<tr>
<td>
Inicial:
</td>
<td>
<input type="text" name="searchfechainicial" id="searchfechainicial" class="fieldtextsearch calendariojqry" readonly="readonly" value="<? echo $_GET['searchfechainicial'] ?>" />
</td>
<td>
Final:
</td>
<td>
<input type="text" name="searchfechafinal" id="searchfechafinal" class="fieldtextsearch calendariojqry" readonly="readonly" value="<? echo $_GET['searchfechafinal'] ?>" />
</td>
<td>
<input type="submit" name="bqd_enviarfechas" id="bqd_enviarfechas" value="Buscar" class="fieldbuttonsearch" />
</td>
</tr>
</form>
</table>
<!--tabla de opciones de busquedad--->
</td>
</tr>
<tr>
<td class="titulogeneralpag">
negocios
</td>
</tr>
<tr>
<td align="right" class="lettergeneral">
Exportar :
<a href="javascript:window.print()" ><img src="../img/print.png" title="Imprimir" style="border:0px; width:32px; height:32;" /></a>
</td>
</tr>
<tr>
<td align="center">
<?php include ("../grid/grid_negocio.php");?>
</td>
</tr>
<td>
<? include_once('../includes/footer.php')?>
</td>
</table>
</td>
</tr>
</table>
<!-- termina tabla principal--->
</body>
</html>