R
R
Ruslan Absalyamov2019-04-06 10:29:52
Yii
Ruslan Absalyamov, 2019-04-06 10:29:52

How to reload a specific pjax container?

I have a problem here. I put one container on the counter in the site template

$(document).ready(function () {
    setInterval(function () {
        $.pjax.reload({container: '#notification-count'});
    }, 10000);
});

It works fine, but if on the page I put another container
<?php Pjax::begin(['id' => 'financy-index-pjax']) ?>...<?php Pjax::end() ?>

This pjax works if the form is submitted.
Then the page reloads. How to make one container reload and the page does not reload?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Максим Тимофеев, 2019-04-08
@rusline18

указывайте formSelector для контейнеров, если его не задать, любая форма будет вызывать reload
https://www.yiiframework.com/doc/api/2.0/yii-widge...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question