title: yii2 gridview filter on related column
body: <p>I have joined 2 tables on my model search with </p>
  
  <pre><code>$query = Surveys::find()-&gt;select('surveys.*,regions.name AS region_name, published.description as published_name');
          $query-&gt;joinWith(['region']);
          $query-&gt;joinWith(['published0']);
  </code></pre>
  
  <p>I have now added sorting for the 2 extra columns</p>
  
  <pre><code>$dataProvider-&gt;setSort([
              'attributes' =&gt; [
                  'name',
                  'description',
                  'survey_type',
                  'published_name' =&gt; [
                      'asc' =&gt; ['published.description' =&gt; SORT_ASC],
                      'desc' =&gt; ['published.description' =&gt; SORT_DESC],
                      'label' =&gt; 'Published',
                      'default' =&gt; SORT_ASC
                  ],
                  'region_name' =&gt; [
                      'asc' =&gt; ['regions.name' =&gt; SORT_ASC],
                      'desc' =&gt; ['regions.name' =&gt; SORT_DESC],
                      'label' =&gt; 'Region'
                  ]
              ]
          ]);
  </code></pre>
  
  <p>I am not sure how to do filtering for these 2 columns. following is what i have</p>
  
  <pre><code> $query-&gt;andFilterWhere([
              'survey_id' =&gt; $this-&gt;survey_id,
              'published' =&gt; $this-&gt;published,
              'date_added' =&gt; $this-&gt;date_added,
              'total_length' =&gt; $this-&gt;total_length,
              'region_id' =&gt; $this-&gt;region_id,
              'shrink' =&gt; $this-&gt;shrink,
              'country_id' =&gt; $this-&gt;country_id,
              'region_name' =&gt; $this-&gt;region_name,
              'published_name' =&gt; $this-&gt;published_name
          ]);
  
          $query-&gt;andFilterWhere(['like', 'name', $this-&gt;name])
              -&gt;andFilterWhere(['like', 'description', $this-&gt;description])
              -&gt;andFilterWhere(['like', 'guid', $this-&gt;guid])
              -&gt;andFilterWhere(['like', 'year_acquired', $this-&gt;year_acquired])
              -&gt;andFilterWhere(['like', 'year_processed', $this-&gt;year_processed])
              -&gt;andFilterWhere(['like', 'survey_type', $this-&gt;survey_type])
              -&gt;andFilterWhere(['like', 'processing_type', $this-&gt;processing_type])
              -&gt;andFilterWhere(['like', 'center_point', $this-&gt;center_point])
              -&gt;andFilterWhere(['like', 'regions.name', $this-&gt;region_name])
              -&gt;andFilterWhere(['like', 'published.description', $this-&gt;published_name]);
  </code></pre>
  
  <p>I have also included the public variables in the <code>Surveys</code> model</p>
  
  <pre><code> public $region_name;
       public $published_name;
  </code></pre>
  
  <p>On my <code>gridview</code> the 2 columns appear and i can sort them however there is no input box for filtering. how can i filter this?</p>