How to change value on the fly

QuestionsHow to change value on the fly
Birger Lehner asked 4 years ago

Hello,

I have sen you login data for my site.

I need to display a string rather then the actual value from database (which is INT). How can I do this?

Example:

value = 0 then value = “no”

value = 1 then value = “yes”

value = 3 then value = “not decided”

Should I do a select inside a select and create a table with INT => string?

4 Answers
pavlos nikiforidis answered 4 years ago

$col[“editoptions”][“value”] = “3:not decided;1:yes;0:no”;

 

https://www.gridphp.com/demo/demos/apps/todos.phps

line 220

BiLe answered 4 years ago

Perfect. Thank you Sir.

I have added:

$col[“formatter”] = “select”;
$col[“editoptions”][“value”] = “0:no;1:yes”;

Works like a charme.

Note: Check if the code has correct quotes when you copy paste.

BiLe answered 4 years ago

Is there away to export the select as well, instead of the INT?

Abu Ghufran Staff answered 4 years ago

Hello,

I’ve emailed you latest build that contains the fix of it.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

17 + 15 =

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?