I am quite new to yii and I came to this company where an application was developped with yii 1.1 and I have to maintain it now
I have a bit of difficulties to understand what came with the framework and what came from the development team
I am asked to modify a search form that seems to use EchMultiSelect extension
I went through some code and I want to add a multi select list box to this form, but I am having some problems
I tried to add this code
<span style="width: 50%;" class="cell">
<?php echo $form->label($model, 'Régie'); ?>
<?php $this->widget('ext.widgets.EchMultiSelect.EchMultiSelect', array(
'model' => $model,
'dropDownAttribute' => 'regie',
'data' => GxHtml::listDataEx(regie::model()->findall('statut="Actif"')),
'dropDownHtmlOptions'=> array(
'style'=>'width:225px;',
),
'options' => array(
'checkAllText' => Yii::t('application','Tous'),
'uncheckAllText' => Yii::t('application','Aucun'),
'selectedText' =>Yii::t('application','# choix'),
'selectedList'=>25,
'noneSelectedText'=>'',
'multiple'=>true,
'filter'=>true,
),
'filterOptions'=> array(
'label' => Yii::t('application','Filtre:'),
'width'=>125,
'placeholder'=>Yii::t('application','Rechercher'),
),
)); ?>
</span>
but it is giving the following error (translated from french) when I am showing the form
The property « Pige.regie » is not defined
which pige is a table on my database and this form is the file _search of models/pige
the problem is when I use name instead of dropDownAttribute and model, it shows the form correctly, and I do want to understand why it works in a case and not the other and if something is missing in my model
<span style="width: 50%;" class="cell">
<?php echo $form->label($model, 'Régie'); ?>
<?php $this->widget('ext.widgets.EchMultiSelect.EchMultiSelect', array(
'name' => 'regie',
'data' => GxHtml::listDataEx(regie::model()->findall('statut="Actif"')),
'dropDownHtmlOptions'=> array(
'style'=>'width:225px;',
),
'options' => array(
'checkAllText' => Yii::t('application','Tous'),
'uncheckAllText' => Yii::t('application','Aucun'),
'selectedText' =>Yii::t('application','# choix'),
'selectedList'=>25,
'noneSelectedText'=>'',
'multiple'=>true,
'filter'=>true,
),
'filterOptions'=> array(
'label' => Yii::t('application','Filtre:'),
'width'=>125,
'placeholder'=>Yii::t('application','Rechercher'),
),
)); ?>
</span>