Lookup Value

QuestionsLookup Value
Shannon G DeWitt asked 3 years ago

I have a field a store as letters A P V

Instead of showing A P V I would like to show the real name. This is not store in another table for lookup. Can I do it without adding a lookup table?

5 Answers
Abu Ghufran Staff answered 3 years ago

Hi,

Yes. You can use static values for dropdown. With these values “key:value;key:value;key:value”.

e.g.

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

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Shannon answered 3 years ago

I have already tried that and it didnt work $col = array(); $col[\\\”title\\\”] = \\\”Game Type\\\”; $col[\\\”name\\\”] = \\\”gametype\\\”; $col[\\\”edittype\\\”] = \\\”select\\\”; $col[\\\”editoptions\\\”] = array(\\\”value\\\”=>\\\’p:pinball;v:Arcade;c:Custom\\\’); $cols[] = $col; I am still seeing p v and c in the table http://gameroom.gameatl.com/admin/test6.php

Abu Ghufran Staff answered 3 years ago

You need to set formatter as well. Apologies, Should have told earlier.

$col["formatter"] = "select";
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Shannon DeWitt answered 3 years ago

PERFECT, thats it!! Thanks!

Your Answer

9 + 6 =

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?