shivani parmar shivani parmar - 2 years ago 236
PHP Question

stop pjax to replace a link with return data

i have put below code

/* helpers */
use yii\helpers\Html;
use yii\helpers\URL;

use yii\grid\GridView;
/* widgets */
use yii\widgets\Pjax;
use yii\bootstrap\Modal;

echo Html::a('view',URL::to(['view','id'=>$model->_id]),['class'=>'show']);

this code show a anchor link and after click of this link it replace a link with data return by ajax.

I don't want to replace a link with data. I need link as it is with return data.

Before I click on a view anchor link

enter image description here

After click of view link

enter image description here

Answer Source

I'd either return the link with the modal HTML or target the link from the Pjax widget, linkSelector.

echo Html::a('view',URL::to(['view','id'=>$model->_id]),['id' => 'view_link', 'class'=>'show']);
Pjax::widget(['id'=>'view_member', 'linkSelector' => '#view_link']);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download