title: yii sort by a custom attribute
body: <p>In my <em>Vacation</em> model <em>Vac</em> I have this function </p>
  
  <pre><code>public function getVacCount(){
  </code></pre>
  
  <p>this function returns how many days there are in one vacation.</p>
  
  <p>and I want to add a custom column to the cgridview like this:</p>
  
  <pre><code>   &lt;?php
      $this-&gt;widget('zii.widgets.grid.CGridView', array(
              ...
              array(
                  'name' =&gt; 'count',
                  'value' =&gt; '$data-&gt;getVacPeriod()'
              ),
              ...
          ),
      ));
      ?&gt;
  </code></pre>
  
  <p>it works fine.
  but I don't know how can I sort upon this custom attribute.
  I tried to use CSort but it does not work. any idea?</p>