Sort handler for pseudo field in views
you should pass 'click sortable' => TRUE parameter together with 'handler':

...
  'field' =&gt; array(
    'handler' =&gt; 'views_handler_my_custom_field',
    'click sortable' =&gt; TRUE,
  ),
...


Then you can override click_sort($order) in your views_handler_my_custom_field class, e.g. you can explicitly override the 'orderby' array of query object:

function click_sort($order) {
  ...
  $this-&gt;query-&gt;orderby[] = array(
    'field' =&gt; '...', // here may be a field, or some SQL clause e.g. FIELD(str, str1, ...)
    'direction' =&gt; strtoupper($order),
  ...
);


See also click_sort($order) in views_handler_field class.

HTH,
Alexander