Mr Abu,
I have master detail grid, then i want to get PK value of the master when i click add or edit butto in detail grid.
How i get the pk value?
Regards,
Samsun
To get master grid row id on clientside:
jQuery('#list1').jqGrid('getGridParam','selrow');
To set in detail grid hidden field (test):
$opt["edit_options"]["afterShowForm"] = 'function (form) { $("#test").val( jQuery('#list1').jqGrid('getGridParam','selrow') ); }';
To get master grid row id on server side in on_insert/on_update events, use $_GET[rowid] as in demos/masterdetail/master-detail.php
function add_client(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["client_id"] = $id;
}
function update_client(&$data)
{
$id = intval($_GET["rowid"]);
$data["params"]["client_id"] = $id;
}
I am unable to identify the issue in it.
Can you email me steps and screenshots to generate this case?
Thanks.
Email: [email protected]
in detail my code like this:
$cid = intval($_GET["ID"]);// ex.: 1
$sql_2 =" SELECT * from table where id=$cid";
$g->select_command = "SELECT * from table where id=$cid";
in select command $cid value is true, like this:
$g->select_command = "SELECT * from table where id=1";
but in $sql_2 value is wrong, like this
$sql_2 =" SELECT * from table where id=0";
would you like to solve my problem?
Regards,
Samsun