get_dropdown_value

Questionsget_dropdown_value
Gustavo Lazaro asked 2 years ago

Hi Abu. My question is the following. I have two grids. In grid 2, I need to make a "$ g-> get_dropdown_values" for a field ($ col ["formatter"] = "select"), depending on a value in a field in grid 1.

8 Answers
Gustavo Ageitos answered 2 years ago

Hi Abu. I wanted to know if my query was understood? Thank you

Abu Ghufran answered 2 years ago

Hi,

You can make grid1 (master) and grid2 (detail grid).
Then pass the param of grid1 that you want in grid2 dropdown query.

Now in grid2 dropdown query, you can pass this param in onload.sql param e.g.
$gender = $_GET["gender"]; // from grid1
$col["editoptions"]["onload"]["sql"] = "select distinct client_id as k, name as v from clients where gender='$gender'";

Hope it help.

Gustavo Ageitos answered 2 years ago

How serious is this case? Thank you

$col = array();
$col["title"] = "Comprobante";
$col["name"] = "comprobante";
$col["editable"] = true;
$col["width"] = "120";
$col["editoptions"] = array("size"=>35, "maxlength" => "35");
$col["formatter"] = "autocomplete";
$col["formatoptions"] = array( "sql"=>"SELECT codProveedoresCabecera as k, CONCAT(tl.tipoLetra, ' ',sucursal, ' ',numero, ' ',date_format(fecha, '%d-%m-%Y'), ' ', totalComprobante-totalPagado) as v from proveedorescabeceras pc INNER JOIN tipoletras tl ON tl.codTipoLetra=pc.codTipoLetra", "search_on"=>"numero", "update_field" => "codProveedoresCabecera");
$cols[] = $col;

Abu Ghufran answered 2 years ago

Hello,

I don't understand your query.
Please explain with more detail / code

Gustavo Ageitos answered 2 years ago

Abu. The php is a master detail, the master passes as parameters the idVoucher and idProvider. The master detail relation is with idVoucher. The second parameter is to make a filter with $ col ["formatter"] = "autocomplete";

Abu Ghufran answered 2 years ago

You can pass the master grid param in sql query of autocomplete.
$idVoucher = $_GET["rowid"]; // from grid1
and use this variable in sql query of autocomplete.

Abu Ghufran answered 2 years ago

I dont understand completely but you can use $_GET variables in line 405 query as you did on line 377.

Your Answer

14 + 4 =

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 / 5. Vote count:

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

Let us improve this post!