S
S
Sergey Bard2018-05-31 11:49:29
Yii
Sergey Bard, 2018-05-31 11:49:29

How to replace output block with pjax?

Hello everyone, I can not understand why this expression does not work?

Yii::$app->response->getHeaders()->set('X-Pjax-Container', '#blockForLoadfunction');

and in the responses it still returns the default p0
, the point is that when pjax is in the controller, I need to make it return renderAjax to another block on page

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Bard, 2018-06-01
@serg_small_developer

I decided like this, on the page with the desired view I added the following code

$this->registerJs(
   '
    $("#timerId").on("pjax:end", function() {
      $("#blockForLoadfunction").append( $("#modal-success_time_checker") );
    });
    '
);

M
Mykola, 2018-05-31
@iSensetivity

https://www.yiiframework.com/wiki/772/pjax-on-acti...

$this->registerJs(
   '$("document").ready(function(){ 
    $("#new_country").on("pjax:end", function() {
      $.pjax.reload({container:"#countries"});  //Reload GridView
    });
    });'
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question