Hi,
To get selected row id in JS you can refer this api: https://www.gridphp.com/docs/javascript-api-faqs/
To receive in php, you need some custom ajax call OR trigger insert/update/delete and use callback events to get the posted data.
Check callback event, onSelectRow event usage below:
Hi Abu,
Thank you for your response.
I have tried gone through the link but could not be able to solve my problem.
below is my code,
<?php
include_once(“config.php”);
include(PHPGRID_LIBPATH.”inc/jqgrid_dist.php”);
// Database config file to be passed in phpgrid constructor
$db_conf = array(
“type” => PHPGRID_DBTYPE,
“server” => PHPGRID_DBHOST,
“user” => PHPGRID_DBUSER,
“password” => PHPGRID_DBPASS,
“database” => PHPGRID_DBNAME
);
$col = array();
$col[“title”] = “FullName”; // caption of column, can use HTML tags too
$col[“name”] = “cabinet_name”; // grid column name, same as db field or alias from sql
$col[“width”] = “40”; // width on grid
$col[“editable”] = true;
$cols[] = $col;
$col = array();
$col[“title”] = “Pin”; // caption of column, can use HTML tags too
$col[“name”] = “cabinet”; // grid column name, same as db field or alias from sql
$col[“width”] = “40”; // width on grid
$col[“link”] = “display-pdf.php?cabinet={cabinet}”;
$col[“linkoptions”] = “target=’_self'”;
$col[“editable”] = true;
$cols[] = $col;
$col = array();
$col[“title”] = “Date”; // caption of column, can use HTML tags too
$col[“name”] = “date”; // grid column name, same as db field or alias from sql
$col[“width”] = “40”;
$col[“editable”] = true;
$cols[] = $col;
$g = new jqgrid($db_conf);
$id2 =$_GET[“id”];
$grid[“caption”] = “Sample Grid”;
$g->set_options($grid);
$g->table = “uploaded”;
$id = intval($_GET[“id”]);
$g->set_columns($cols);
$out = $g->render(“list1”);
I want to use the selected ID in the query below
$Orig = $do->gett(“select * from uploaded where id =’$id'”);
if I put the actual rowid it works fine. like
$Orig = $do->gett(“select * from uploaded where id =’123456′”);
Kindly help .