php - how to use drop down list of a cgrid view in yii? -


hi, know should simple new php , yii. so, please, bear me. have table named thefriends has columns(thepals,address,phone numbers). admin page uses cgridview list these friends in usual format. want text boxes replaced drop down menus. know can done using following code in views/thefriends/admin.php

'columns'=>array(   'id',   'array'(    'name'='thepals',    'filter'=array(1=>'alice',2=>'jenna'), 

)

but see have populate values myself, instead want values prepopulated particular column.. please help..

use chtml::listdata object filter. instance, let's assume related thepals table has columns id , name.

'columns' => array(     'id',     array(         'name' => 'thepals',         'filter' => chtml::listdata(thepals::model()->findall(),'id','name'),     ... ), 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -