GridView combined with pjax

Hi Guys

I followed the documentation of using gridview with pjax.

I did the standard workflow like that:




Pjax::begin();


GridView::widget([

    'id' => 'xyz',

    'dataProvider' => $dataProvider,

    'filterModel' => $model,

    'columns' => [

        'first_name',

        'last_name'

    ]

]);


Pjax::end();




The first time, when I try to filter one of the rows it works perfectly. and it updates my gridview in the pjax manner. but the second time i try to make an other filter and make "enter" on my keyboard it doesnt work and it also doesnt makes a pjax request. Im wondering if the second time the yiiGridView js fucntion is hooked correctly. pagination and sorting are working even after second pjax calls etc.

i would be realy happy if someone could help here out, i already spent much time for this issue.

thanks

Im still trying but not getting the right result.

for me it looks like a bug of the framework.

After a pjax request the gridview doesnt load following from his run()-method:


GridViewAsset::register($view);

$view->registerJs("jQuery('#$id').yiiGridView($options);");

I searched the source code couldnt find the yii.gridview.js file and also not the yiiGridView-Method.

After reloading the same page (withouth pjax) this two snippets are loaded and it works (withouth pjax effect).

This shows me that there is a bug in the framework itself.

because after a pjax call as i saw should the renderAjax()-Method register all needed bundles, but for the gridview he is not loading the needed js files.

Could you show us your controller code?

I modified every thing, because i couldnt find a solution.

now im loading the gridview the "old normale" way. that ensures that the gridview.js und the depending method for the gridview are loaded correctly. I went until deep the heart of the framework. i figured out, that when you load in a page over pjax a gridview, which was not loaded before, the depending js files are not loaded. the reason is I guess, that i makes it very difficult to load the depending js files "inline" in the file, because this js files are also depending on other js files like jquery etc. but this issue could be solved with a good concept. but its not that trivial.