好吧,我确实有带有 ajaxsubmitbutton 的部分表单并且它工作正常,但是如果我尝试使用另一个 ajaxsubmitbutton 部分呈现另一个表单,或者甚至在该表单下添加另一个提交按钮,它就不起作用。这是我的ajaxbutton代码:
echo CHtml::ajaxSubmitButton(
'Delete', array(
'submit' => $this->createUrl('logInOfficeEmp/delete', array('id' => $model->id)),
'type' => 'POST',
), array('type' => 'post',), array('id' => 'deletesubmit',));
原因可能是因为该操作应该是 delete :
jQuery('body').undelegate('#deletesubmit','click').delegate('#deletesubmit','click',function(){jQuery.ajax({'type':'POST','url':'/mySystem/index.php?r=logInOfficeEmp/update&id=159', 'cache':false,'data':jQuery(this).parents("form").serialize()});return false;});
});