Chtml Ajax And Overlay Div

index.php:a classical overlay div, to show some ajax data.




   echo CHtml::ajaxButton('Sources', CController::createUrl("SourcesAjax"), array(

                'type' => 'GET',

                'success' => 'function(data){

         $("#afe-source-ovderlay").show();

        $("#afe-overlay").show();

         $("#afe-source-ovderlay").html(data);

          $("#afe-overlay").click(function() {


            $("#afe-source-ovderlay").hide();

            $("#afe-overlay").hide();


        });


     }',

   ), 

               

            );

controller


public function actionSourcesAjax(){

            

            $sources=  Afe::model()->getSources();

            $subsources=  Afe::model()->getSubSources();

           

          echo $this->renderPartial('_sources', array('sources'=>$sources,'subsources'=>$subsources));

        

        }

The problem:

In _source.php, I cannot use any ajax , why ?

how send ajax request FROM _source.php(the content of the overlay DIV).

Any idea please?

To explain more:

after loading the source data, I need to send a new ajax request after the user choose a source.

but calling an ajax function inside the content that its loaded through an ajax function, it is not possible?

you can do another ajax call success callback

Please explain more "Alirz23"

I need a Depending Dropdown Selection, inside the overlay DIV

i cant use call back ajax function for this purpose