Yii Framework Forum: problem with adding a EchMultiSelect with dropDownAttribute - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

problem with adding a EchMultiSelect with dropDownAttribute Erro on using EchMultiSelect with dropDownAttribute

#1 User is offline   drusixtynine 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 29-February 16

Posted 29 February 2016 - 04:28 PM

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>
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users