Master detail

QuestionsMaster detail
Gustavo Lazario asked 4 years ago

Dear Abu. I would like to know if you can use a parameter sent from the master through the command:

$opt [“detail_grid_id”] = “list2”;
$opt [“subgridparams”] = “codPlanningHead, codCategory, planningIntensity, planningTypeExercise”;

I would like to use the parameter “codCategory” in the “where” where the “select” $str = “SELECT minutecode AS k, minute AS v FROM minutes WHERE …” is defined

$col = array ();
$col [“title”] = “Minutes”;
$col [“name”] = “codMinuto”;
$str = $ g-> get_dropdown_values ​​(“SELECT minutecode AS k, minute AS v FROM minutes”);
$col [“stype”] = “select”; // enable dropdown search
$col [“searchoptions”] = array (“value” => $ str, “separator” => “:”, “delimiter” => “;”);
$col [“edittype”] = “select”;
$col [“editoptions”] = array (“value” => $ str, “separator” => “:”, “delimiter” => “;”);
$col [“formatter”] = “select”;
$col [“editable”] = true;
$col [“width”] = “20”;
$col [“align”] = “center”;
$col [“visible”] = “sm +”;
$cols [] = $ col;

1 Answers
Abu Ghufran Staff answered 4 years ago

Hi,

Yes, that’s doable.

You can get master grid passed parameters in detail using:

$id = intval($_GET[“rowid”]);
$gender = $_GET[“gender”];

And to use in select dropdown, you need to set like following. The onload-sql is the query with WHERE clause. The previous is also required.

$col = array();
$col[“title”] = “Invoices”;
$col[“name”] = “note”;
$col[“width”] = “100”;
$col[“search”] = true;
$col[“editable”] = true;
$col[“edittype”] = “select”;
$str = $grid->get_dropdown_values(“select distinct note as k, note as v from invheader”);
$col[“editoptions”] = array(“value”=>”:;”.$str);

$sql = “select distinct note as k, note as v from invheader WHERE client_id = $id”;
$col[“editoptions”][“onload”][“sql”] = $sql;
$cols[] = $col;

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

9 + 14 =

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?