How To Get A Drop Down In Every Row Of A Cgridview ?

Hi,

I have the following problem:

I want a drop down in EVERY row of a CgridView

(Including Javascript. That means once I change the value of a dropdown I want some Javascriopt to execute)

How is that achived? All tries failed so far using the regular ways to change the rows (i.e "raw").

Help is really appreciated!

THX

Dear Friend

Below is one implementation.Kindly check whether it is helpful.

Declaring a column.




array(

'name'=>'student_id',

//Take care of single and double quotes...


'value'=>'CHtml::dropDownList("student","",CHtml::listData(Student::model()->findAll(),"id","name"),array("id"=>$data->id,"class"=>"drop"))',

'type'=>'raw' 

		),



Registering a javascript function in admin.php




Yii::app()->clientScript->registerScript('drop','

    $("body").on("change",".drop",function(){

	    console.log($(this).attr("value"));

            console.log($(this).attr("id"));

	});


');



Regards.