Gridview And Pjax

I try using pjax and filter grid data but I would like to have one search field before a grid, not a standard grid filter field after header row. I wrote the code like below. It work’s but all requests clear my input field and URL is longer and longer with the same parameter from first request.

something like this:


?MailingListSearch[name]=lista1&MailingListSearch[name]=lista2&_pjax=%23grid-pajax&MailingListSearch[name]




    Pjax::begin(

			   	  [

			   	  'timeout'=>999999,

			   	  'id'=>'grid-pajax'

				  ]

				 );

			     

			     

			     $form = ActiveForm::begin([

			     		'method' => 'get',

			      		'options' => ['data-pjax' => '1'],

			     		]

			     );

			     

			     echo Html::tag('div',Html::input('text','MailingListSearch[name]',null,

			     		['id'=>'gridFinder','class'=>'form-control']),['class'=>'left']);

		

			    ?>  

			    <div class="form-group center">

			     			        <?= Html::submitButton('Find')?>

			     </div>

			     <?php 			

			     ActiveForm::end(); 

			     echo GridView::widget([...])


                             Pjax::end();

			     ?>



OK I find a solution myself. I must add action attribute to ActiveForm options




   $form = ActiveForm::begin([

			[b]'action' => '/mailing-list/index',[/b]

			'method' => 'get',

			'options' => ['data-pjax' => '1'],

			]);



To get back data to form field I set $requestparam = Yii::$app->request->getQueryParams(); in my Controller and set in renderAjax method, then I can read GET data in my view file.