Hello, i have this:
$opt2[“onAfterSave”] = “function(){ var selr = jQuery(‘#list1’).jqGrid(‘getGridParam’,’selrow’); jQuery(‘#list1’).trigger(‘reloadGrid’,[{jqgrid_page:1}]); setTimeout( function(){jQuery(‘#list1’).setSelection(selr,true);},500 ); }”;
in the set on a 2d grid (list2) for when i save, reload in first grid (list1), but the reloading just works with edit event, not with add and delete event…. why????
this in the rest of code….
$e2[“on_after_insert”] = array(“fff”, null, true);
$e2[“on_after_update”] = array(“fff”, null, true);
$e2[“on_after_delete”] = array(“fff”, null, true);
}
$grid2-> set_events($e2);
function fff(&$data)
{
$id = intval($_GET[“rowid”]);
$sql = “select (GROUP_CONCAT(clientes.nombre ORDER BY clientes.nombre SEPARATOR ‘, ‘)) AS x FROM clientes,tarios WHERE clientes.id=tarios.cliente AND tarios.tipo=’P’ AND tarios.client_id=”.$id;
//phpgrid_error($sql);
global $grid2;
$result = $grid2->get_one($sql);
$x = $result[‘x’];
//phpgrid_error($x);
$grid2->execute_query(“UPDATE inm SET nombre = ‘$x’ WHERE id=”.$id);
}
thanks