There is any option to sort for global view field.

Comments

damiankloip’s picture

Do you mean a sort handler, or the option to make it sortable in tables etc..? Because if so, that is disabled by design.

Anonymous’s picture

ya i want table sorting.

Exploratus’s picture

Issue summary: View changes

I second table sorting - really need it! :) A sort handler would be fantastic as well. But table sorting is so critical!

jemisond’s picture

Another call for table sorting!

Marco van Bemmel’s picture

Can't this be done with Views PHP?
I've installed the Views PHP module and added global PHP field to 'Sort criteria' and added

return $row1->view < $row2->view ? -1 : (int) ($row1->view > $row2->view);

...but no results yet...

damiankloip’s picture

You are generally dealing with a rendered view at that point? So sorting by an html string seems like it might get a bit on the tricky side... ?

andrewigman’s picture

Yep, i have the same need!
What do you (damiankloip) mean by "it might get a bit on the tricky side..."?
It is impossible or could i acomplish trough a patch? or maybe creating a custom module?
thanks!

damiankloip’s picture

Really #5, I'm pretty sure that will not work...

This module renders views at render time. After query, sorting etc... people need to understand that almost all table sorting works at the sql level. You can't add an order by to your query for another view that hasn't been rendered yet.

Even if you could. You would sort by rendered view html? Or which results. It's unfeasible to try and support in the module.