Hi there Rick,

This solution is similar to Bobby's, but with a CF+jQuery twist.

First, when a new realtor is added to a list, the assigned seniority sort
order number will be the maximum number.  Example, if there are 9 realtors,
the new/added realtor will have sort order number (seniority_id) 10.

Next, you can use jQuery's Interface Draggable and Sortable plugin
http://interface.eyecon.ro/docs/sort  to reorder the list.  The user then
drags the 10th realtor (the added guy) to the 2nd position (new seniority).
Once saved, the submitted form will post a serialized list of realtor_id
numbers in the desired sort order. You can then loop through the list and
update the seniority_id of all realtors using the realtor_id as your index.

The demo is at: http://interface.eyecon.ro/demos and select Sortable list.

This is a very scalable solution.

Hope that helps, Rick.

Michael



> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 13, 2007 10:42 AM
> To: CF-Talk
> Subject: How to re-order items?
> 
> Hi, all.
> 
> I'm trying to figure out the best approach to
> ordering the display of Real Estate agents on
> a website.
> 
> I have it by last name currently, but my client
> wants to re-order by Seniority.
> 
> So, I figured I'd just put a field in the database
> called "Display_Order" and then the person who
> manages the site could provide a number for
> each person. e.g. 1 on top, 2 next, etc.
> 
> The problem would come when an agent
> gets added to the list who would be between 1 and 2.
> (I don't want to use decimals).
> 
> I can instruct the manager of the site to put 10 for the top
> spot, then 20 for the second, etc.  That leaves room for
> additional spots to be added between 10 and 20.
> 
> However, I'm looking for a long-term solution.
> 
> Would it be a good approach to have them initially number
> the agents starting with 10, then 20, and have them say, use
> 15 if someone needed to between 10 and 20, but code the
> site so that all number are rounded up to increments of 10
> upon entry into the database?
> 
> 10 stays 10, but 15 becomes 20, 20 becomes 30, etc.
> 
> Is that a good solution?  What other solutions have any
> of you used for this?
> 
> Thanks for the insight.
> 
> Rick
> 
> (Remember. CF 4.5 here. :o)
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:269690
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to