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.

回答1:

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.



回答2:

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.



回答3:

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?



标签: ajax yii partial