get dropdown values

Questionsget dropdown values
Stephaan asked 5 years ago

Hi,

Can I add the cell value in die get_dropdown_values query.

 

Example:

$col = array();
$col[“title”] = “primary key”;
$col[“name”] = “pkey”;

$col[“fixed”] = true;
$col[“width”] = “460”;
$col[“editable”] = true;
$col[“hidden”] = false;
$col[“resizable”] = true;
$col[“search”] = true;

 

$str = $g->get_dropdown_values(“select distinct pkey as k, name as v from qualifications Where pkey = “$col[“name”] = “pkey”;””);

 

so the drop down will only show where the pkey match current cell pkey.

 

Kind Regards

2 Answers
Abu answered 5 years ago

Try following:

$str = $g->get_dropdown_values(“select distinct pkey as k, name as v from qualifications”);

$col[“editoptions”][“value”] = $str;
$col[“editoptions”][“onload”][“sql”] = “select distinct pkey as k, name as v from qualifications Where pkey = ‘{pkey}'”;

This will reload dropdown and use onload-sql query to fill dropdown.

Stephaan answered 5 years ago

Hi,

I used that from the start but I am having an issue using the Onload function, when I inline edit and the select box states “loading” and before it updates and I save the row edit , the data get saved as blank. So data gets lost.

So that is why I wanted to query it from the start using the current column value.

Seems then I wont be able to accomplish what i wanted,

 

Thanks for the help.

Your Answer

3 + 12 =

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?