Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/10/2011, 16:15
Avatar de romangus
romangus
 
Fecha de Ingreso: octubre-2011
Mensajes: 3
Antigüedad: 12 años, 6 meses
Puntos: 0
De acuerdo Respuesta: jqGrid y PHP pierden las variables

Observo que también la solución podría andar por la penúltima linea del archivo grid.php:
Código PHP:
$grid->renderGrid('#grid','#pager',truenullnulltrue,true); 
Pues según la documentación del metodo renderGrid: [URL="http://www.trirand.com/blog/phpjqgrid/docs/jqGrid/jqGridRender.html#methodrenderGrid"]www.trirand.com/blog/phpjqgrid/docs/jqGrid/jqGridRender.html#methodrenderGrid[/URL]

Este método puede recibir un parámetro que se puede pasar a un query, aunque en grid.php está como null y no recibe nada mediante GET o POST, en el archivo detail.php si tiene ahí una variable, y además recibe mediante GET.

Esta linea en el archivo detail.php está así:
Código PHP:
$grid->renderGrid("#detail","#pgdetail"true$summaryrow, array(&$rowid), true,true); 
y al principio del archivo hay esto:
Código PHP:
// Get the needed parameters passed from the main grid
if(isset ($_REQUEST["CustomerID"]))
    
$rowid jqGridUtils::Strip($_REQUEST["CustomerID"]);
else
    
$rowid ""
A continuación la documentación del método renderGrid:

Main method which do allmost everthing for the grid

Construct the grid, perform CRUD operations, perform Query and serch operations, export to excel, set a jqGrid method, and javascript code

Parameters:

string $tblelement: the id of the table element to costrict the grid
string $pager: the id for the pager element
boolean $script: if set to true add a script tag before constructin the grid.
array $summary: - set which columns should be sumarized in order to be displayed to the grid By default this parameter uses SQL SUM function: array("colmodelname"=>"sqlname"); It can be set to use other one this way : array("colmodelname"=>array("sqlname"=>"AVG")); By default the first field correspond to the name of colModel the second to the database name
array $params: parameters passed to the query
boolean $createtbl: if set to true the table element is created automatically from this method. Default is false
boolean $createpg: if set to true the pager element is created automatically from this script. Default false.
boolean $echo: if set to false the function return the string representing the grid

API Tags: Access: public