Problem With Render

Greetings, I’m new in Yii. I’ve been making 2 dropdown lists, from the examples I’ve found here on the web. Now, I’m trying to get selected ID from then second dropdown list and send it to another View to load Grid View for this i will try use ajax button.

In my index view i have the button ajax:


<?php

	echo CHtml::ajaxButton ("Ver Eventos", CController::createUrl('Site/Events'),

							array('type'=>"POST",

							'update' => '#data',

							'data'=> array('modo_id' => 'js:document.getElementById("Modes_Id_Mode").value')));


?>

this works well, gets the value and calls the controller action

Then i call the action "Events" in my controller for get to records where "Mode=id_modo".


	//Ver Eventos

	public function actionEvents(){

		$model=new Events('user');

		if (isset ($_POST['modo id'])){

			//Recogo el valor del dropdown lsit cargo los registros que contengan ese modo FUNCIONA pero no renderiza la vista "

			$data['idmodo'] = $_POST['modo_id'];

			$model=Events::model()->findByAttributes(array('Mode'=>$data['idmodo']));	

	}

	$this->render('events',array('model'=>$model));

	}

I saw in the firebug that the action Events response is the html code from events view, but after click the ajax button my controller dont redirect from events view and stay in index. How i can fix this problem?

Srry for my english.