0

I want to sort results set first based on one column and then based on second column. I know how to do it on server side. And then I want to show these results with pagination feature.

Question: would it be better to do it on client side via ajax in jQuery? I'm using Zend Framework. Would Zend_Paginator module be useful in this scenario? I mean if unordered set is returned by server then using jquery to sort results based on any two columns would be better option, I think? How can I do that?

Basically I want to evaluate all the possible ways. Which one would be best and/or simplest option given I'm using jQuery and Zend Framework?

Community
  • 1
  • 1
understack
  • 11,212
  • 24
  • 77
  • 100

1 Answers1

1

If you are going to send the whole result to client. You can use a Jquery plugin eg. Datatable. It can paginate and sort

otherwise to sort and paginate in mysql, the sql would look like:

SELECT * FROM data SORT BY first_column ASC, second_column DESC LIMIT 20, 10

LIMIT 20, 10, means , select 10 rows at offset of 20, which means, show 10 rows in page 3

Codler
  • 10,951
  • 6
  • 52
  • 65
  • Accepted this answer. I fount this link http://www.packtpub.com/article/jquery-table-manipulation-part2 useful. – understack Mar 30 '10 at 10:38