Yii ajaxlink in partial

2019-02-15 19:31发布

I'm using Yii framework and have small problem. Then I include to the partial CHtml::ajaxLink, link stopping work as ajax, standart click is raised and performs redirect to another page. Can anyone help me? Thanks.

标签: ajax yii partial
3条回答
Root(大扎)
2楼-- · 2019-02-15 20:07

Just a supposition, but turn processOutput on when using partialRender with javascript. It's the fourth parameter when calling renderPartial:

$this->renderPartial('_view',array(params...),false,true)

ProcessOutput allows you to also load javascript when rendering with asynchronous calls or other stuff.

查看更多
叼着烟拽天下
3楼-- · 2019-02-15 20:08

Maybe you not finishing document right? try with:

 Yii::app()->end();

And check differences in generated HTML between old version (which worked) and this one. Maybe some js lib not included?

查看更多
你好瞎i
4楼-- · 2019-02-15 20:09

Turn firebug on and check for js errors. If there are any, post them here

There was something wrong with yii CHtml::ajax implementation, and it caused me similar bug to yours.

查看更多
登录 后发表回答