Please help with conditional defining grid

QuestionsPlease help with conditional defining grid
Michael W Olson asked 2 years ago

Why does this work:

$whichGrid=”fuel_usage.php”;
$myTable=”fuel_usage”;
include(“grids/”.$whichGrid);

But this doesn’t?

$whichGrid=”fuel_usage.php”;
if(isset($_POST[‘section_loc’])){
$myTable=”fuel_usage”;
}
include(“grids/”.$whichGrid);

1 Answers
Abu Ghufran Staff answered 2 years ago

Hello,

Perhaps, You need to move the include inside the ‘if’ statement.
e.g.

$whichGrid=”fuel_usage.php”;
if(isset($_POST[‘section_loc’])){
    $myTable=”fuel_usage”;
    include(“grids/”.$whichGrid);
}

Basically, setting table property is necessary for data to show. Currently you are just unsetting the table and all grid code is still in execution.
I don’t know how you are implementing file fuel_usage.php, If above does not solve, you can share that file as well and then I can suggest better.

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

7 + 18 =

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?