Una imagen para que me entiendan mejor:
[img]https://skydrive.live.com/?cid=4c77c0423a6ee197#!/?cid=4c77c0423a6ee197&sc=documents&uc=1&id=4C77C0423A6EE197!119!cid=4C77C0423A6EE197&id=4C77C0423A6EE197!153&sc=documents[/img]
Javascript:
$("#list3").jqGrid({ url:'ajax_listar.php',
datatype: "json",
colNames:['id','Fecha', 'Responsable', 'Detalle','Proveedor','Valor Unitario','Cantidad Entradas','Valor Entradas','Cantidad Salidas','Valor Salidas','Cantidad Saldo','Valor Saldo'],
colModel:[{name:'idk',index:'idk', width:40, sorttype:"int",editable:true},
{name:'fecha',index:'fecha', width:65, sorttype:"date",editable:true},
{name:'responsable',index:'responsable', width:80,editable:true},
{name:'detalle',index:'detalle', width:90,editable:true},
{name:'proveedor',index:'proveedor', width:100, sortable:false,editable:true},
{name:'valor_unitario',index:'valor_unitario', width:80, align:"right",sorttype:"float",editable:true},
{name:'cant_entradas',index:'cant_entradas', width:80, align:"right",sorttype:"int"},
{name:'val_entradas',index:'val_entradas', width:80,align:"right",sorttype:"float"},
{name:'cant_salidas',index:'cant_salidas', width:80, align:"right",sorttype:"int"},
{name:'val_salidas',index:'val_salidas', width:80,align:"right",sorttype:"float"},
{name:'cant_saldo',index:'cant_saldo', width:80, align:"right",sorttype:"int"},
{name:'val_saldo',index:'val_saldo', width:80,align:"right",sorttype:"float"}],
rowNum:10,
rowList:[10,20,30],
pager: '#pager3',
sortname: 'idk',
viewrecords: true,
sortorder: "asc",
caption: "Hoja de Kardex",
editurl:"ajax_editarreg.php"
});
//--------------------------------------
$("#list3").jqGrid('navGrid','#pager3',{edit:true,add:false,del:false});
editar.php:
<?php
include("../lib/conexion.php");
$id=$_POST['idtabla'];//este es el id que recibo del formualrio emergente y que no se debe modificar
$fecha=$_POST['fecha'];
$detalle=$_POST['detalle'];
$proveedor=$_POST['proveedor'];
$cmd = ADONewConnection($driver);
$cmd->Connect($host,$user,$clave,$database);
$rs = $cmd->Execute("update tbkardex set fecha='".$fecha."' where idk=".$id);
$cmd->Close();
?>