Gridview filters in pjax loaded view

Hello guys,

i have a problem with the gridview filters. I load a view through pjax. In that view i render an other view which includes a girdview. But when loaded through pjax the filters are not working. Where iam going wrong?

My view looks like this:


<?php Pjax::begin(); ?>

...

...

$form = ActiveForm::begin(['type'=>ActiveForm::TYPE_HORIZONTAL]);

...

...

<?php ActiveForm::end(); ?>


// Load gridview

<?= $this->render( '_invoices', [

                'dataProvider' => $dataProvider,

                'model' => $model,

                'searchModel' => $searchModel,

] ); ?>

<?php Pjax::end(); ?>

I found out the cause, due to the pjax load of main content div, i have now two script sections with jquery for gridview filters. Is there any way to come around this? Thanks in advance for your help!