Ajax Doesnt Work In The Second Page Of Clistview

i want to delete an item of clistview via ajax button. it works in the first page, but not other pages. Could somebody please help me?


public function actionIndex() {

	$criteria = new CDbCriteria(array(

		'order' => 'create_at DESC',


	$dataProvider = new CActiveDataProvider('Note', array(

		'pagination' => array(

			'pageSize' => 10,


		'criteria' => $criteria,



	$this->render('index', array(

		'model' => $model,

		'dataProvider' => $dataProvider,



view: index

<?php $this->widget('zii.widgets.CListView', array(







Yii::app()->clientScript->registerScript('note-delete-js', "

	$(document).ready(function() {

		$('#note-list .delete').click(function() {

			var elem = $(this).closest('.post');


				type: 'POST',

				url: '/xxx/index.php/note/delete/'.concat($(this).next().val()),



			return false;



	    $('#note-list .delete').confirm({

	        msg:'Do you really want to delete this Note?',






view: _view

<div class="post">

	<div class="content">

		<?php echo GxHtml::encode($data->content); ?>



		<a class="btn delete">Delete</a>

		<input type="hidden" value="<?php echo $data->id;?>">



you have to use delegated events for that.


i found a solution

$('#note-list .delete').live('click', function() {


above way, i the delete button works, but the ‘confirm’ still doesnt work. anyone any ideas?

.live() is deprecated, use on() instead