Yii 删除行clistview不';我不再工作了

Yii 删除行clistview不';我不再工作了,yii,Yii,我在CListView中有一个delete函数,它以前可以工作,但现在不工作了 在CListView中,我有: echo CHtml::link('<img src="images/delete.png" />', $this->createUrl('persoon/delete',array('id'=>$data->id)), array(// for htmlOptions

我在CListView中有一个delete函数,它以前可以工作,但现在不工作了

在CListView中,我有:

echo CHtml::link('<img src="images/delete.png" />',
                    $this->createUrl('persoon/delete',array('id'=>$data->id)),
                    array(// for htmlOptions
                      'onclick'=>' {'.CHtml::ajax( array(
                           'beforeSend'=>'js:function(){if(confirm("Are you sure you want to delete?"))return true;else return false;}',
                           'success'=>"js:function(html){ alert('removed'); }"
                           )).
                         'return false;}',// returning false prevents the default navigation to another url on a new page 
                    'class'=>'delete-icon')
                );

没有错误,但单击时不会删除项目。有人知道这里发生了什么吗?

http请求返回了什么?现在认为它什么也不返回。我真的不明白它为什么会起作用,因为当我将url更改为$this->createUrl('test/test',array('id'=>$data->id')时,当这个页面不启动时,它不会给出任何错误。页面persoon/delete应该做些什么?执行beforeSend事件吗?是的,成功了,我想控制器会马上处理它。。。这是正确的吗?
public function actionDelete($id)
    {
        $this->loadModel($id)->delete();

        // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
        if(!isset($_GET['ajax']))
            $this->redirect(array('index'));
    }