Ver Mensaje Individual
  #16 (permalink)  
Antiguo 06/08/2011, 12:38
wewo
 
Fecha de Ingreso: agosto-2011
Mensajes: 2
Antigüedad: 12 años, 9 meses
Puntos: 0
Respuesta: Como Mostrar Datos en un JqGrid()

Que tal a todos...

Tengo un problema realmente serio en relación a este tema y me he cansado de probar formas sin resultado. Veo que son entendidos del tema por lo que solicito su AYUDA.

Tengo una jqGrid que presenta los datos sin problema cuando hago pruebas en localhost pero cuando lo subo a su sitio no presenta nada... realmente no entiendo que estoy haciendo mail. Estoy desarrollando en PHP y la BD es MySQL... me he asegurado que los campos sean los mismos.

Gracias de antemano

Codigo HTML:

$(function(){
$("#details").jqGrid({
url:'cot_recibidas.php',
datatype: 'xml',
mtype: 'GET',
colNames:['Id','Desde','Categoria','Bien/Servicio', 'Unidad','Cantidad','Fec.Lanzmto.','Fec.Rpta.','Ce rrado','Rpta'],
colModel :[
{name:'id', index:'idDetalle_Cot', width:50},
{name:'nombre', index:'nombre', width:150},
{name:'idcategoria', index:'idcategoria', width:50},
{name:'bs', index:'bs', width:250},
{name:'und', index:'und', width:40, align:'right'},
{name:'qty', index:'qty', width:40, align:'right'},
{name:'feclan', index:'feclan', width:110, align:'right'},
{name:'fecesp', index:'fecesp', width:110, align:'right'},
{name:'cerrado', index:'cerrado', width:50, align:'center'},
{name:'rpta', index:'rpta', width:50, align:'center'}
],
pager: '#pagerdetail',
rowNum:20,
rowList:[20,30,50],
sortname: 'idDetalle_Cot',
sortorder: 'desc',
viewrecords: true,
multiselect: false,
gridview: true,
caption: 'Cotizacion Recibidas',
height: 300,


loadComplete: function(){

var vnueva = "<?php echo $_POST['nueva']?>";

if (vnueva == "Y"){
var reg = "<?php echo $_POST['registro']?>"; //document.getElementById("previo").value;
jQuery("#details").setSelection(reg,true);

//jQuery("#details").jqGrid('setGridParam',{url:"exa mple2.php?q=1&id="+reg,page:1});
//jQuery("#details").trigger('reloadGrid');
}

},


Codigo PHP Fuente de datos:

header("Content-type: text/xml;charset=utf-8");

$s = "<?xml version='1.0' encoding='utf-8'?>";
$s .= "<rows>";
$s .= "<page>".$page."</page>";
$s .= "<total>".$total_pages."</total>";
$s .= "<records>".$count."</records>";


while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$s .= "<row id='". $row['idDetalle_Cot']."'>";
$s .= "<cell>". $row['idDetalle_Cot']."</cell>";
$s .= "<cell>". $row['nombre']."</cell>";
$s .= "<cell>". $row['idCategoria']."</cell>";
$s .= "<cell>". $row['BS']."</cell>";
$s .= "<cell>". $row['Und']."</cell>";
$s .= "<cell>". $row['Qty']."</cell>";
$s .= "<cell>". $row['FecLan']."</cell>";
$s .= "<cell>". $row['FecEsp']."</cell>";
$s .= "<cell>". $row['Cerrado']."</cell>";
$s .= "<cell>". $row['Rpta']."</cell>";
$s .= "</row>";
}
$s .= "</rows>";

echo $s;