Re: how to sort in django template

2008-06-18 Thread Austin Govella

On Jun 18, 2:53 am, laspal <[EMAIL PROTECTED]> wrote:
> I have a list of employee and i want to sort it.
>
>  Employee( this is my header)
> under which i have list of employee.
>
> So now my question is on clicking employee header I want to change the
> list.
> Like it happens for user in django admin.

Google "unobtrusive javascript table sort"

Here's a sample:
* 
http://www.frequency-decoder.com/2006/09/16/unobtrusive-table-sort-script-revisited


Put the list in a table. Employee changes from an  to a . Each
employee name goes in a  in a separate . Add a script, and
it'll sort like magic.



--
Austin

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to sort in django template

2008-06-18 Thread Florencio Cano

I don't understand what exactly are you trying to do but I think the
dictsort filter could help.

On 18 jun, 09:53, laspal <[EMAIL PROTECTED]> wrote:

> I have a list of employee and i want to sort it.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to sort in django template

2008-06-18 Thread yml

Hello,
I would see 2 approach to solve the problem you are describing :
 * Server side -  Order the list of employees in your view before
passing it to the template
 * Client side - use a JS to order a Javascript variable

I hope this will help you.
--yml

On 18 juin, 09:53, laspal <[EMAIL PROTECTED]> wrote:
> hi,
> I have a list of employee and i want to sort it.
>
>  Employee    ( this is my header)
> under which i have list of employee.
>
> So now my question is on clicking employee header I want to change the
> list.
> Like it happens for user in django admin.
>
> Please help me out.
>
> Thannks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---