H
H
hollanditkzn2017-04-27 12:05:35
Yii
hollanditkzn, 2017-04-27 12:05:35

How to search across multiple gridviews?

Good afternoon! I can’t think of and find an answer on how to do a single search on 4 gridview tables if there is only one model. Do I need to access the model or do I look for it in some other way?
And the search needs to be done in such a way that it does not look for the column of the table, but if it occurs in the table, it displays it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-04-27
@hollanditkzn

single search across 4 gridview tables

4 gridviews or 1 gridview of 4 tables in a database?
If the second then 1 searchModel in it joins and filters for related data
In any column? Then something like this:
public $q_text;
$query->orFilterWhere(['like', 'column_1', $this->q_text])
            ->orFilterWhere(['like', 'column_2', $this->q_text])
            ->orFilterWhere(['like', 'column_3', $this->q_text]);

M
Mi7teR, 2017-04-27
@Mi7teR

www.yiiframework.com/wiki/621/filter-sort-by-calcu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question