I can't say much about the technique other than be careful with
javascript based table sorting.

If you have an largeish table (100+) rows with more than 4 or 5
columns the Javascript sort can be very slow.  Javascript isn't the
fastest language around and unless you have very optimized sort
algorithims it can cause the page to seemingly hang to the user.

The browser might also warn the user a script is taking a long time to
execute and give them the option of aborting it - they wont know they
are killing the sort though and will wonder why their sort didn't
happen.

For general javascript table sorting I wrote a nice unobtrusive
routine (that incorporates some work of others as noted in the
documentation) that works pretty well (with the exception of the
conditions previously listed).  It is freely available at:
http://rawlinson.us/blog/?p=147

Bill


On 11/23/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Under an MVC design is there any best place to sort results?  My natural
> inclination is to say this would occur at the view stage since a particular
> sorted order is most appropriate to how and why the user is viewing the
> data.  The model shouldn't care about the order of things.
>
> Generally I accomplish this by running a query of a query in the view or
> controller before display.
>
> <cfquery dbtype="query" name="sortedQuery">
> select * from myQuery
> order by #sortOrder#
> </cfquery>
>
>
> I've also been using table sorting javascript to reorder the table rather
> than performing a page refresh.
>
> More recently I've been returning unsorted arrays of objects instead of
> queries.  This means when the page first loads it is unsorted and a
> javascript call must be made to sort it.
>
>
> Any comments on this technique?
>
>
> Jason Cronk
>
>
>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to 
> [email protected] with the words 'unsubscribe cfcdev' as the subject of the 
> email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
> (www.cfxhosting.com).
>
> An archive of the CFCDev list is available at 
> www.mail-archive.com/[email protected]
>
>
>


--
[EMAIL PROTECTED]
http://blog.rawlinson.us

If you want Gmail - just ask.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to