我有两个pjax的表格。当单击第二个PJAX中的链接时,将查询发送到服务器,但在字段“X容器”中写入ID第一个容器。
Pjax::begin([
'id' => 'register-form'
]);
...
Pjax::begin([
'id' => 'que'
]);
echo yii\helpers\Html::a('update', ['/portal/que/gr-usl/');
Pjax::end();
...
Pjax::end();单击update后的位置:/portal/que/gr-usl?_pjax=%23register-form
请求标头
X-PJAX:true
X-PJAX-Container:#register-form
X-Requested-With:XMLHttpRequest如果设置数据-pjax for link #que请求头没有更改。
发布于 2017-07-18 05:40:26
对于pjax禁用数据中的所有链接-pjax将href更改为onclick with function
$.pjax({url: $(el).attr('link'), container: '#pjax-grusl'});链接有代码
echo yii\helpers\Html::a('update', null,[
'data-pjax' => 'false',
'link' => \yii\helpers\Url::to(['/portal/que/gr-usl/',
'ids' => $ids,
'filter' => $filter,
'gr' => $gr
]),
'onclick' => 'selGr(this)'
]);但是它应该在方框中工作:(我不明白为什么没有从dom树中找到第一个pjax容器。
https://stackoverflow.com/questions/45146306
复制相似问题