View Single Post
  #4 (permalink)  
Old 07-11-2008, 12:31 PM
smsiebe smsiebe is offline
Junior Member
 
Join Date: Oct 2007
Location: Augusta, GA
Posts: 9
Default

Hello,

In addition to providing initial sorting functionality, anticipate the the user will want to vary their sorting once they have it on the page just by clicking the column header. While functionality such as passing parameters to the controller to return the data from the database in a particular sort order, it does increase the amount of server-side code and logic to handle the sorting. Also, when and if you change the number of columns, you'll have to cascade the change across your sorting logic. Not to mention the page refresh each time.

In most cases, implementing a client-side sortable grid (table) would be the best solution. Work with the customer to determine their preferred default sort, and let them change the sort of the data at the client-side (no need for page refresh or AJAX call - assuming the data stays the same based on sort).

I highly suggest you check out dojo, as ZF is currently integrating Dojo. Do a little reading on building a grid (some great ones available as dojoX components), you'll probably be suprised how easy it is.

Even if you have a paginated data source, implementing an AJAX call back to the server is quite easy using Dojo. Get use to it now...it will be here soon =)

Hope this helps,

Steve
__________________
Steve Siebert
Zend Certified Engineer
General Dynamics IT
www.get-dev.com
Reply With Quote