$col["default"] from simple array

Questions$col["default"] from simple array
SirShadow asked 10 years ago

Hi there,

I'm trying to set a default value from an array to be shown in grid.

$array = array(1=>"Val 1"…);
$col["name"] = "col"; // this has numerical value
$col["edittype"] = "select";
$col["editoptions"] = array("value"=>[operation with array]);
$col["default"] = $array["{col}"];

Off course the above example it's shown value of "col" (1,2..) not the $array["{col}"] (Val 1, Val 2…). But the add/edit it is ok. How do I make this working?
Thank in advance.

2 Answers
Abu Ghufran answered 10 years ago

You can remove "default" and set formatter.

$col["formatter"] = "select";

This is show the label as display, and id for postback purpose.

SirShadow answered 10 years ago

Thank you! Now it's OK.
Maybe you can add in docs page such example

Your Answer

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