Two Columns in get_dropdown_values

QuestionsTwo Columns in get_dropdown_values
Azhar Abdallah asked 8 years ago

Dear Sir,

Is there any way to have two columns in the get_dropdown_values. I have along list and need to show the ID No. with Name in the same dropdown.

Thank you in advance.

Best regards,

3 Answers
Abu Ghufran answered 8 years ago

You can concat both fields in select query that you pass to get_dropdown_value.

Azhar Abdallah answered 8 years ago

Dear Abu Ghufran,

Thank you for your reply. The dropdown is work with two columns.

I use the following:

$str = $grid->get_dropdown_values("select distinct applicant_id as k, concat(applicant_id , ' – ', applicant_name) as v from applicants");

When add a new record i got "undefined" as a default value in the dropdown.

Is there anything wrong?

Best regards.

Azhar Abdallah answered 8 years ago

Dear Abu Ghufran,

Please disregard my comment above. I solve this issue.

Best regards.

Your Answer

12 + 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?