Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with select column #130

Closed
emontes opened this issue Jul 13, 2014 · 3 comments
Closed

Problem with select column #130

emontes opened this issue Jul 13, 2014 · 3 comments

Comments

@emontes
Copy link

emontes commented Jul 13, 2014

I have the following
$categories = array();
foreach ($em->getRepository('Noticias\Entity\Category')->findBy(array(), array('title' => 'ASC')) as $item) {
$categories[strval($item->getCatid())] = $item->getTitle();
}
$col = new Column\Select('catid','s');
$col->setLabel('Categoría');
$col->setReplaceValues($categories,false);
$grid->addColumn($col);

But When I got the select I get:
-BacalarCancúnCaribe MexicanoChetumalCobáCozumelEl EstadoEventosMexican CaribbeanPlaya del CarmenPolíticaPuerto MorelosRiviera MayaTextosTulum

Where the values not correspond with the values in the array that I have sended, I have noticed that if I put some string in the array key then the Select goes right, but It don't correspond with the values for replace.

@ThaDafinser
Copy link
Owner

Can you dump the result array completely?

@emontes
Copy link
Author

emontes commented Jul 13, 2014

My $categories array is:
array(15) { [6]=> string(7) "Bacalar" [4]=> string(7) "Cancún" [15]=> string(15) "Caribe Mexicano" [13]=> string(8) "Chetumal" [9]=> string(5) "Cobá" [5]=> string(7) "Cozumel" [11]=> string(9) "El Estado" [14]=> string(7) "Eventos" [16]=> string(17) "Mexican Caribbean" [10]=> string(16) "Playa del Carmen" [12]=> string(9) "Política" [8]=> string(14) "Puerto Morelos" [3]=> string(12) "Riviera Maya" [1]=> string(6) "Textos" [7]=> string(5) "Tulum" }

And the html that is returning me in the select part is

option value="0" selected="selected">Bacalar
option value="1">Cancún
option value="2">Caribe Mexicano
option value="3">Chetumal
option value="4">Cobá
option value="5">Cozumel
option value="6">El Estado
option value="7">Eventos
option value="8">Mexican Caribbean
option value="9">Playa del CarmenPolítica
option value="11">Puerto Morelos
option value="12">Riviera Maya
option value="13">Textos
option value="14">Tulum

@ThaDafinser
Copy link
Owner

This issue was moved to zfc-datagrid/zfc-datagrid#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants