title: Yii2: How to sort a GridView's column that doesn't belong to its model
body: <p>I made a model and its CRUD using Gii from a table called <strong>vacations</strong>. Its index.php has a GridView with two columns called <strong>Column 1</strong> and <strong>Column 3</strong>. Then I added a column called <strong>Person</strong> that come from a table called <strong>persons</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/WxX6r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WxX6r.png" alt="GridView"></a></p>
  
  <p>The problem is that the column <strong>Person</strong> is not sortable.</p>
  
  <p>So I have this tables (<strong>column1_id</strong> and <strong>person_id</strong> are primary key of their tables):</p>
  
  <pre><code>vacations: column1_id, column3.
  persons: person_id, person_name, column1_id.
  </code></pre>
  
  <p>Maybe I have to add something in the VacationsSearch file.</p>