Hello…
I placed in a form the following instruction:
<?php echo EHtml::activeDropDownList($model, 'orden', $model->getOrderList())?>
with getOrderList() implemented as follows:
public function getOrderList()
{
$db = Yii::app()->getDb();
$command = $db->createCommand('SELECT orden AS value, CONCAT(orden, " - (", nombre, ")") AS text
FROM ' . $this->tableName() . '
ORDER BY orden');
$rows = $command->queryAll();
$ultimo = 0;
$listaOrdenes = array();
$listaOrdenes[] = array('0'=>'0 - Primera');
for ($i=0, $n=count( $rows ); $i < $n; $i++)
{
$ultimo = $rows[$i]['value'] + 1;
$listaOrdenes[] = array($rows[$i]['value']=>$rows[$i]['text']);
}
$listaOrdenes[] = array($ultimo=>$ultimo . ' - Ultima');
return $listaOrdenes;
}
Why the combobox is shown as in the attached image?
282
Thanks a lot in advance
Jaime