I Have Created A Year Dropdown. And Have A Grid In The Same View. As Below:

I have Created a year dropdown. and have a grid in the same view. as below:

<div style="" class="search-form">

<div class="form summary">

<?php $form=$this->beginWidget(‘CActiveForm’, array(

‘action’=>Yii::app()->createUrl($this->route),

‘method’=>‘get’,

)); ?>

<div class="row">

<?php echo $form->labelEx($model,‘year’); ?>

<?php echo CHtml::activedropDownList($model,‘years’,$model->getYears()); ?>

<?php echo $form->error($model,‘year’); ?>

<?php echo $form->labelEx($model,‘name’); ?>

<?php

$this->widget(‘zii.widgets.jui.CJuiAutoComplete’, array(

‘name’=>‘name’,

‘source’=>$this->createUrl(‘reports/autocompleteTest’),

‘options’=>array(

    'delay'=&gt;300,


    'minLength'=&gt;2,      


    'showAnim'=&gt;'fold',

),

));

?>

<?php echo $form->error($model,‘name’); ?>

<?php echo $form->labelEx($model,‘Status’); ?>

<?php echo $form->dropDownList($model,‘is_active’,array(“1”=>“Active”,“0”=>“InActive”)); ?>

<?php echo $form->error($model,‘Status’); ?>

</div>

<div class=“summary_btn buttons”> <?php echo CHtml::submitButton(‘Search’); ?> </div>

<?php $this->endWidget(); ?>

and grid is :

<?php

//$dataProvider->getData();

$this->widget(‘zii.widgets.grid.CGridView’, array(

‘id’=>‘users-grid’,

‘dataProvider’=>$dataProvider,

‘dataProvider’=>$model->searchSummery(),

‘columns’=>array(

array(

'header' =&gt; 'Employee',


'value'=&gt;'&#036;data-&gt;fullName',  


),  

array(‘name’=>‘Taken®’,‘value’=>’$data->getYearDataR($data->user_id)’),

array(

'name'=&gt;'Taken (M)',


'value'=&gt;'&#036;data-&gt;getYearDataM(&#036;data-&gt;user_id)'),

),

)); ?>

My Problem is: i want to pass the selected value of year dropdown to "getYearDataR" function.

i am getting the selected value as below in controller:

public function actionviewHistory()

{

&#036;this-&gt;pageTitle = CHtml::encode(Yii::app()-&gt;name).' :: Reports :: View Report';    





&#036;model=new Users;   


&#036;model-&gt;unsetAttributes();  


if(isset(&#036;_GET['Users'])){


    &#036;model-&gt;attributes=&#036;_GET['Users'];


    &#036;model-&gt;searchSummery();


    }





if(isset(&#036;_REQUEST['Users']['years']) &amp;&amp;  &#036;_REQUEST['Users']['years']&#33;=&quot;&quot;)


{


    &#036;years = &#036;_REQUEST['Users']['years'];           


}





&#036;dataProvider=new CActiveDataProvider('Users', array(


    'criteria'=&gt;array('condition'=&gt;'is_active = 1'),


));


&#036;this-&gt;render('view_history',array('model'=&gt;&#036;model,'dataProvider'=&gt;&#036;dataProvider));

}

I am getting the selected value in $years, please help me how can i pass this value to CActiveDataProvider.

>> My Problem is: i want to pass the selected value of year dropdown to "getYearDataR" function.

I dont see your "getYearDataR" function

>> I am getting the selected value in $years, please help me how can i pass this value to CActiveDataProvider.

if you trying to filter the result based on the selected years $years use criteria and pass in the conditions, if thats not what you want the explain what you trying to I might be able to help you