Sort handler for pseudo field in views I have made a custom views field handler by the following instruction:

http://www.interactivejunky.com/blog/database-independent-views-3-custom-field-handlers

The problem is that, I cannot sort the values of the created pseudo field in view. I know the reason is that my pseudo field basically doesn't exist in query of the corresponding view, and cannot exist there as it doesn't exist in any tables and it's just a computed field for that view.

Any ideas about making this field sortable?
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