Hello,
I have a problem, whatever i do my subgrid stay empty.
in my parent I have
[…]
$opt[“subGrid”] = true;
$opt[“subgridurl”] = “Function/IngredientRecipe.php”;
$opt[“subgridparams”] = “RecipeId”;
$g->set_options($opt);
[…]
in the IngredientRecipe.php i have :
if (!empty($_POST[“RecipeId”]))
{
$_SESSION[“RecipeId”] = $_POST[“RecipeId”];
}
$id = $_SESSION[“RecipeId”];
$g->select_command = “SELECT ri.* FROM RecipeIngredients AS ri WHERE RecipeId = $id”;
and my grid appear normally but the subgrid is empty (no line just white space)
Hello,
To debug, open browser debug console (F12) > network tab. And then open subgrid. It will send an ajax call to new page. Now right click on that request and select open in new tab.
It will show correct details about the output and possible error on subgrid page. You can also check php error log for reason behind blank output.
Hello,
Thank you for your fast reply, when I open the debug console network and open the subgrid (clicking on the arrow for expend) there is no Ajax request, like if $opt[“subgridurl”] = “Function/IngredientsRecipe.php”; was never executing.
When I do and call directly :
[php]
$g = new jqgrid($db_conf);
$opt[“caption”] = “Surowców”;
$g->set_options($opt);*/
$g->select_command = “SELECT ri.* FROM RecipeIngredients AS ri WHERE RecipeId = 16”;
$content = $g->render(“ListIngredients”);
require(“View/Template.php”);
[/php]
it’s working and show me a normal grid but when I want to put it in subgrid with the code of my first message is not working. do “subgrid_detail.php” so in my case “Function/IngredientRecipe.php” require something else than query and code seen in my first message ?
If “(clicking on the arrow for expend) there is no Ajax request”, there must be some JS error. Check browser console and send scrrenshot. It solution is online, it would help resolving fast.