Yii Framework Forum: [SOLVED] Dropdownlist dengan 2 nilai display value ? - Yii Framework Forum

Jump to content

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

[SOLVED] Dropdownlist dengan 2 nilai display value ? Rate Topic: -----

#1 User is offline   iansyah_vox 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 30-December 10

Posted 01 February 2011 - 11:41 PM

Pagi rekan2

Mau Tanya nih..

sy kan bikin dropdownlist seperti ini

echo $form->dropDownList($model,'id_supplier', CHtml::listData(Supplier::model()->findAll(), 'id', 'nama_supplier'));


nah dropdown di atas display yang di tampilin kan hanya nama_supplier

pertanyaan sy , gimana caranya kalo sy mau nampilin id dan nama_supplier sekaligus

tampilannya jadi seperti ini

id - nama_supplier

misal

S001 - PT. Bahtera Nusantara

Thx
Ian
0

#2 User is offline   jimmi nababan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 12-October 09

Posted 01 February 2011 - 11:56 PM

cek link ini bro :

http://www.yiiframew...__fromsearch__1



View Postiansyah_vox, on 01 February 2011 - 11:41 PM, said:

Pagi rekan2

Mau Tanya nih..

sy kan bikin dropdownlist seperti ini

echo $form->dropDownList($model,'id_supplier', CHtml::listData(Supplier::model()->findAll(), 'id', 'nama_supplier'));


nah dropdown di atas display yang di tampilin kan hanya nama_supplier

pertanyaan sy , gimana caranya kalo sy mau nampilin id dan nama_supplier sekaligus

tampilannya jadi seperti ini

id - nama_supplier

misal

S001 - PT. Bahtera Nusantara

Thx
Ian

0

#3 User is offline   iansyah_vox 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 30-December 10

Posted 02 February 2011 - 12:18 AM

View Postjimmi nababan, on 01 February 2011 - 11:56 PM, said:




Thx ya Jimmi

Sorry td juga udah coba searching...cuma salah kata kunci kali ya, jd ga nemu..hehe.. maklum newbie :)

btw udah solved nih sekali lg thx ya..
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