ThatÂ’s easily avoided with the way I do it. You only have 2 options per
record... move up or move down. Any time a record is deleted... you just
`selct field from table order by sortorder` then loop over that and update
the sortorder for each record with #currentrow# to keep them in sequence.


-----Original Message-----
From: Doug Brown [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 13, 2007 2:11 PM
To: CF-Talk
Subject: Re: How to re-order items?

Another thing is that if you do it based upon a number and let the client
order by the number, he will be re-ordering all the time when new agents are
hired. I would not do it that way myself since the agents could change quite
often.

Doug B.
----- Original Message ----- 
From: "Michael Wright" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Tuesday, February 13, 2007 11:56 AM
Subject: RE: How to re-order items?


> Rick
>
> I'm not sure how you your client defines seniority but a couple of ideas
of
> the top off my head.
> If it's based on length of service add a database field called joindate
and
> sort on that.
> Or if it's on say job title/rank add a jobtitleid field which references a
> separate table with jobtitle and weight fields or more simply just assign
> each jobtitle a number.
>
> Regards
> Michael
>
> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: 13 February 2007 18:42
> 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:269688
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