Nice! Worked well for me.

On Jan 30, 11:39 pm, mdipierro <[email protected]> wrote:
> P.S. Use CSS to customize them. The default id for the generated
> unordered list is "sortable".
>
> On Jan 30, 11:25 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
> > I made a plugin for sortable of lists via ajax.
>
> >  plugin_sortable.py
> > 1KViewDownload
>
> > 1) Put the file in models
>
> > 2) Assuming you have a table with items to be sorted like:
>
> >      db.define_table('test',Field('name'),Field('sortable','integer'))
>
> > 3) Display the items in your favorite view:
>
> >     {{=plugin_sortable([(r.id,r.name) for r in  
> > db
> > (db
> > .test
> > .id
> >  >
> > 0).select(orderby=db.test.sortable)],callback=URL(r=request,f='sort'))}}
>
> > 4) Add a callback controller
>
> > def sort():
> >      plugin_sortable_sort(db.test,sortable_field='sortable')
>
> > 5) Look at the code because there are some extra arguments for  
> > customization.
>
>

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

Reply via email to