Ajax And Pagination

Hi i am new in Yii, If anyone can please help me

Here is my Problem:

I have a dropdownlist and Listview. When Dropdownlist changes the datas in List view also change according to dropdownlist.Using Ajax i can do it but i can not implement Pagination in It.How can i do Pagination in this situation?

The query i am using to show data is not simple query it contain two more joins…

thanks in advance…

why are you using dropdownlist for Listview???

Please also post you source code, so yii members can help to resolve your issue easily.

Please send your only related code or screenshot here. So someone can help you better way.

Portion of my view(_form)

  <table  class="grid_view_table">


        <tr colspan="2">

            <td class="dropdown" style="width:50px">

             <?php $select="";  echo CHtml::dropDownList('TYPE',$select,array('All'=>'All Training','My'=>'My Training'), array('empty' => '(--Select--)','class'=>'form-control input-sm','id'=>'Type')); ?>





        <tr colspan="2"><td> 




                <table id="training_calendar_table" class="table" style="width:920px;">

                  <thead  style="width:920px;display: block;">


                           <th width="80">  <?php echo $form->labelEx($model,'Start Date'); ?></th>

                           <th width="80">  <?php echo $form->labelEx($model,'End Date'); ?><?php //echo CHtml::link('Branch', '#', array('id' => 'sort_link', 'name'=>'branch','class' => 'desc')); ?></th>

                           <th width="150"> <?php echo $form->labelEx($model,'Course'); ?></th>

                           <th width="100"> <?php echo $form->labelEx($model,'Reference No'); ?></th>

                           <th width="50">  <?php echo $form->labelEx($model,'Term'); ?></th>

                           <th width="80">  <?php echo $form->labelEx($model,'Duration'); ?></th>

                           <th width="80">  <?php echo $form->labelEx($model,'No Seats'); ?></th>

                           <th width="150"> <?php echo $form->labelEx($model,'Institute'); ?></th>

                           <th width="120"> <?php echo $form->labelEx($model,'Targeted Audience'); ?></th>




                    <tbody style="width:840px;  height:248px;float: left;   overflow-y: auto; " >

                       <?php   foreach($data as $rows) { 






                        <tr >

                            <td width="80" style="padding-right: 10px"><?php echo $rows['START_DATE']; ?></td>

                            <td width="80"><?php echo $rows['END_DATE']; ?></td>

                            <td width="150"><?php echo $rows['START_DATE'] ?></td>

                            <td width="100"><?php echo $rows['TCS_TRAINING_COURSE_REF_NO'] ?></td>

                            <td width="50"><?php  echo $rows['TCS_TRAINING_COURSE_REF_NO'] ?></td>

                            <td width="80"><?php  echo $rows['TCS_COURSE_DURATION'] ?></td>

                            <td width="80"><?php  echo $rows['TCS_NO_OF_SEAT'] ?></td>

                            <td width="150"><?php echo $rows['INSTITUTE_NAME'] ?></td>

                            <td width="80"><?php  echo $rows['TCS_TARGET_CATEGORY'] ?></td>






                       <?php } ?>

                           <tr><td> <?php if($flag==1){ ?><?php 

                    //Get pagination result

       // echo "hai".$cpage;

                    $this->widget('CLinkPager', array(








                           ));  ?> <?php } ?></td></tr>






My Ajax Call For DropDownlist:




    $('h3.box-title').text("Training Calendar"); //For Changing Box Title





        var selected=$('#Type').val();



                url:"<?php echo Yii::app()->createUrl('Training_Calendar/ViewDetails'); ?>",

                data: {svalue:selected}






        var data = jQuery.parseJSON(html);


















Finally Action in my controller:

 public function actionViewDetails(){


            $model=new Training_Calendar;












                  $dataProvider=new CSqlDataProvider($sql, array(







                   $data = $dataProvider->getData();

                   $response_array = array();

                   $desc = $this->renderPartial('_form', array('model' => $model, 'data' => $data, 'dataProvider' => $dataProvider), true);




                $response_array['html_content'] = $desc;

                echo json_encode($response_array);