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?