ayzed
(Azed77)
February 12, 2013, 12:33pm
1
Hi all…
I have problem regarding to Echmultiselect widget
FYI, i’m trying to save data in batch, and the first step is, i need to populate an object in table list.
i have a problem in populating Echmultiselect object in the list. I have no idea to assign
‘dropDownAttribute’ to every EchMultiselect object in order to make it unique.
I try to assign ‘dropDownAttribute’=> ‘[$i]temp_diet_code’, as how i name it for textField, but the list display with no style as the widget should behave.
here is my code :
<div id="grid-view-item">
<?php
$listPatient = new Patient();
$listPatient->temp_ward_code= $model->diet_order_ward;
$listPatient->temp_class_code= $model->diet_order_class;
// $listPatient->search();
$items = Patient::model()->with('latestDetail')->findAll(array('index'=>'patient_id'));
?>
<?php echo CHtml::beginForm(); ?>
<table>
<tr><th>Patient ID</th><th>Patient Name</th><th>Bed No</th><th>Diet Type</th></tr>
<?php foreach($items as $i=>$item): ?>
<tr>
<td align="left"><?php echo CHtml::label($item->latestDetail->patient_hosp_id,''); ?></td>
<td align="left"><?php echo CHtml::Label($item->patient_name,''); ?></td>
<td align="left"><?php echo CHtml::activeTextField($item,"[$i]temp_bed_no"); ?></td>
<td align="left">
<?php
$data= CHtml::listData(DietRef::model()->findAll(),'diet_code','diet_name');
$this->widget('ext.EchMultiselect.EchMultiselect', array(
'model' => $item,
'dropDownAttribute' => 'temp_diet_code',
'data' => $data,
'options' => array(
'selectedList'=> 4, // 0-based index
'checkAllText' => Yii::t('EchMultiSelect.EchMultiSelect','Select All'),
'uncheckAllText' => Yii::t('EchMultiSelect.EchMultiSelect','Cancel'),
'selectedText' => Yii::t('EchMultiSelect.EchMultiSelect','# Selected'),
'noneSelectedText'=>'-' . Yii::t('EchMultiSelect.EchMultiSelect','Select One') . '-',
//'position'=>array('my'=>'left bottom', 'at'=>'left top'),
'height'=>'120px',
),
'dropDownHtmlOptions'=> array(
'style'=>'width:280px;',
),
));
?></td>
</tr>
<?php endforeach; ?>
Can anyone help me on this… TQ