Yii Framework Forum: [Solved] Echosen Nggak Nampil - Yii Framework Forum

Jump to content

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

[Solved] Echosen Nggak Nampil Rate Topic: -----

#1 User is offline   Finzaiko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 18-November 11
  • Location:Indonesia

Posted 14 November 2012 - 05:03 AM

Hello agan2, ane coba extention echosen sesuai instruksi tinggal taro aja

<?php $this->widget( 'ext.EChosen.EChosen' ); ?> 


di view/_form,
tapi masih gak nongol ya?, kira2 kenapa ya?
btw. bagaimana menampilkan di CActiveForm

Terima kasih atas pencerahannya.
0

#2 User is offline   Finzaiko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 18-November 11
  • Location:Indonesia

Posted 19 November 2012 - 02:00 AM

Beberapa hari yang lalu saya mempunyai pertanyaan bodoh, setelah baca sana sini akhirnya solve juga, ternyata harus dibuat dulu listboxnya alias
<select multiple="multiple"> klo di html biasa
pake arrray :
$data = array('1' => 'Arifin', '2' => 'Eko', '3' => 'Fitri', '4' => 'Yuli');
$htmlOptions = array('size' => '5', 'multiple' => 'true',);
echo $form->listBox($model,'_nik', $data, $htmlOptions);


atau...

pake list data load from model :
$emp=CHtml::listData(Employees::model()->findAll(),'nik','name');
$htmlOptions = array( 'multiple' => 'true','style'=>'width:300px',);
echo $form->listBox($model,'_nik', $emp, $htmlOptions);


nah setelah selesai membuat listboxnya tinggal kita tambahkan echosennya, all code menjadi seperti ini
$emp=CHtml::listData(Employees::model()->findAll(),'nik','name');
$htmlOptions = array( 'multiple' => 'true','style'=>'width:300px',);
echo $form->listBox($model,'_nik', $emp, $htmlOptions);
$this->widget( 'ext.EChosen.EChosen', array('target' => 'select',));


done!

Thanks All
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