Closed claudejanz closed 7 years ago
Full view exemple:
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\Pjax;
Pjax::begin();
echo Html::a('external link', Url::current(), ['class' => 'btn btn-default']);
// internal block
Pjax::begin([
'clientOptions' => [
'skipOuterContainers' => true,
],
]);
echo Html::a('internal link', Url::current(), ['class' => 'btn btn-default']);
Pjax::end();
Pjax::end();
Works fine on yii 2.0.12 don't work correctly on 2.0.13
For a better see of what happens I added time to exemple:
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\Pjax;
$date = new Datetime();
// external block
Pjax::begin([
'clientOptions' => [
],
]);
echo Html::a('external link', Url::current(), ['class' => 'btn btn-default']);
echo Html::tag('p',Yii::$app->formatter->asDatetime($date));
// internal block
Pjax::begin([
'clientOptions' => [
'skipOuterContainers' => true,
],
]);
echo Html::a('internal link', Url::current(), ['class' => 'btn btn-default']);
echo Html::tag('p',Yii::$app->formatter->asDatetime($date));
Pjax::end();
// internal block end
Pjax::end();
// external block end
Solved since merge with latest from defunkt/jquery-pjax
Thank you
Since jquery 3.* compatibility update, nested pjax containers load content of external pjax container. even if skipOuterContainers is set to true.