Populate a drop-down list from JSON

QuestionsPopulate a drop-down list from JSON
DGea asked 2 years ago

Dear Sir,

Is there a script to display the dropdown list using json data with autocomplete

See image : https://imgur.com/a/JfoHDxB

4 Answers
DGea answered 2 years ago

Addition info:

My case is as you see on the picture https://imgur.com/a/QTGXhdo

Abu Ghufran Staff answered 2 years ago

You can fill dropdown with any static values using:

$col[“edittype”] = “select”;
$col[“editoptions”] = array(“value”=>’10:$10;20:$20;30:$30;40:$40;50:$50′);

Now you can call (curl) your JSON api using php, parse JSON and it string like key:val;key:val;key:val etc … and set in editoptions->value option.

If you want JSON api along with dependent dropdown, let me know. I’ll review how it’s doable.
It’s currently not supported and will need some changes as well.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
DGea answered 2 years ago

Yes sir, I still need it. Because, there are many applications that must be bridging with other applications using the API with the JSON data format.  I am very grateful if there is a solution.  Thanks Sir.

Abu answered 2 years ago

Currently JSON api dependent dropdown loading is not supported and can’t give a timeline for it. I’d recommend to follow manual code for it.

Your Answer

20 + 11 =

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?