CGridView widget已具有查看,更新_view文件中CViewList小窗口链接,DETE option.But我用我的基于jQuery Mobile的项目CListView中小部件,但在创建AJAX链接删除选项有问题。不知道如何在_view.php(视图文件)和它的renderPartial()视图文件中创建一个ajax删除链接,以在成功删除plz帮助之后消失该栏。这是用于编辑和删除的_view.php文件链接。如何创建Ajax删除
<?php
echo CHtml::link(CHtml::encode($data->id),
array('editmember1', 'id' => $data->id),
array('data-role' => 'button', 'data-icon' => 'star')
);
echo CHtml::link(CHtml::encode($data->id), $this->createUrl('customer/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',
'id' => 'x' . $data->id)
);
>
链接几乎是罚款,你想完成什么? –
@ bool.dev其未删除的记录,在显示任何错误:( – Coder
确定,目前键入答案 –