Grid sorting query

- Separated grid sorting query into sort and order parameters, to avoid
problems of rewriting other grid's sorting queries.