Good evening to all,
how do I get the value of a field, selecting a record in the grid?
Regard
You need to do it via little JS code
To get selected row id,
var selr = jQuery('#list1').jqGrid('getGridParam','selrow');
if(selr) alert(selr);
else alert("No selected row");
return false;
To get multiple rows selected,
var selr = jQuery('#list1').jqGrid('getGridParam','selarrrow');
if(selr) alert(selr);
Where list1 is the param passed when rendering grid.
// generate grid output, with unique grid name as 'list1'
$out = $g->render("list1");
ok, I have done this,
Now the character of the grid is greater,
// render grid
$out = $g->render("list1");
?>
<script type="text/javascript">
var selr = jQuery('#list1').jqGrid('getGridParam','selrow');
if(selr) alert(selr);
else alert("No selected row");
return false;
</script>
$id_riparazione = ???? how do I get id of the selected record in the grid?
$result = mysql_query("SELECT CLIENTE, MARCA, MODELLO, SERIALE, DIFETTO, DIFETTODICHIARATO, NUMERO, RIVENDITORE
FROM schederivenditori WHERE IDRIPARAZIONE = $id_riparazione");
thanks and good day
If you want to have master-detail bahavior, that selecting parent grid will reflect change in sub grid … this example is covered in master-detail.php in package.
Emailing you in another thread.
the example you gave me does not work, if I comment this code table data client, otherwise I do not see anything, and then when I select the row nothing appears in list2
//if ($non_ajax || $_REQUEST["grid_id"] == "list1")