I must have missed something, trying to use guidance in FAQ>Misc “Q) How to load grid based on $_POST data from other page?”
See example code, using the demo database and stripped to the basics.
https://gist.github.com/rob2009/01ade64ceac311f7b4e6abd256b0ebfb
It’s fine unless you comment out line 16 $SelectedName=”Ana”
Try this change on line 12:
if (!empty($_POST[“name”]))
{
$_SESSION[“name”] = $_POST[“name”];
}
$SelectedName = $_SESSION[“name”];
moving $SelectedName = $_SESSION[“name”]; outside the if statement made no difference
Hello,
You need to create grid object before this session code logic to regain php session.
$g = new jqgrid($db_conf);
if (!empty($_POST[“fname”]))
{
$_SESSION[“fname”] = $_POST[“fname”];
}
$SelectedName = $_SESSION[“fname”];
I have tested it and working fine.