Search code examples
searchyii2dataprovider

yii2 search of one grid view is affecting other gird views


I have multiples Grid Views in index page, Every Grid view (say: pending records Grid view, completed records Grid view, cancelled records Grid view, ... ) has same columns (e.g: name, number, location, ... ) and each of them is having its own search/filter row and every Grid view is making an Pjax call for search.

Until it is making Pjax call every thing is fine, but in some cases (I don't know exact) the page is refreshing and the search is applied for all the grid views (This is the issue).

Please give me the solution for this.

My previous issue was, Each and every Grid view is also having pagination, when I use to click on one Grid view's pagination it was affecting the other Grid view's pagination also and the solution is, I have used different pageParam :

'pagination' => [
    'pageParam' => 'ConfirmedPackage',
],

Is there any similar type of solution for search/filter of the Data Provider?

As after page reload it is taking same class name in the url for searching the grids.

Thank you.


Solution

  • As I mention in my question that the problem is due to the same class name (in the url), I was using the same class for all the search functions in the search model and when I tried with different classes it worked perfectly :).

    Thank you.