Ordering items

26 views
Skip to first unread message

Joel Davey

unread,
Feb 18, 2013, 9:51:32 AM2/18/13
to agil...@googlegroups.com
If I have something like this  the_list.gather(the_item, 'append', '#the_list');
Which puts everything into a <ul></li>

How would I then sort the order of those items.
Specifically I have parent_id and id in my model for the_item.

How would I then loop through each item to show the correct parent>child relationship with nested UL's?


Luis Gonzalez

unread,
Feb 20, 2013, 1:01:46 AM2/20/13
to Agility.js
Hi Joel,

I'm not sure I understood your question, but I guess this has more to
do with your database query than with Agility.
In your gather call, you could add a third parameter corresponding to
your query.

.gather(proto, method, [,selector] [,query])

The query could be, for example, {orderBy:'id'}
This query parameter would be passed to your persistence adapter.

Luis
Reply all
Reply to author
Forward
0 new messages