Php Yii jQuery BBQ删除后出错
我正在使用Php Yii jQuery BBQ删除后出错,php,jquery,ajax,yii,jquery-bbq,Php,Jquery,Ajax,Yii,Jquery Bbq,我正在使用Yii CGridView。列中有删除按钮: array( 'class'=>'CButtonColumn', 'template' => '{update}{delete}', 'buttons' => array( 'delete' => array( 'imageUrl' => false, 'options' => array( 'class'=>'
Yii CGridView
。列中有删除按钮:
array(
'class'=>'CButtonColumn',
'template' => '{update}{delete}',
'buttons' => array(
'delete' => array(
'imageUrl' => false,
'options' => array( 'class'=>'btn btn-danger btn-mini delete-button' ),
)
),
)
单击delete按钮后,我看到ajax请求,然后直接看到js错误
"URL is undefined" from jquery.ba-bbq.js @ 257 line (matches = url
.match( is_fragment ? /^([^#]*)\#?(.*)$/ : /^([^#?]*)\??([^#]*)(#?.*)/ );).
有人知道如何消除这个错误吗
p.s.条目被删除,只有js错误 好的,我找到了解决方案:
用此文件覆盖CGridViewRegisterClient脚本
:
public function registerClientScript(){
//if ajaxUrl not set, default to the current action
if(!isset($this->ajaxUrl))
$this->ajaxUrl = Yii::app()->controller->createUrl("");
//call parent function
parent::registerClientScript();
}
请在上面发布it错误行。我希望您已经这样做了,请清除应用程序资产并重试。@Mave:已更新该行line@RamkrishnaChaulagain字体是的,我试过了。