Empty subgrid

QuestionsEmpty subgrid
Sylvain asked 5 years ago

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)

3 Answers
Abu Ghufran Staff answered 5 years ago

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.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Sylvain answered 5 years ago

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 ?

Abu Ghufran Staff answered 5 years ago

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.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

20 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?