Yup, that's it exactly. It's not efficient from a speed standpoint but it should be fine for you, since presumably this will be an internal application.
On your list of agents page, you could either have an "update" button for each row, or get a little fancier and allow "all at once" updating. This would probably require some dynamic field naming and a little more code to update all the agents' display order values. Then you would run the same re-ordering function as when you add the agent, to update all the display order values to multiples of 10. -- Josh ----- Original Message ----- From: "Rick Faircloth" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Wednesday, February 14, 2007 12:19 PM Subject: RE: How to re-order items? > Interesting approach, Josh... so you're using the current > row (which would be auto-incremented by one) become > the succeeding display order number. Sounds good. > > Let's see if I've got this... > > 1) Show a list of agents with editable text inputs pre-filled with display > order numbers > (which will show in increments of 10) > 2) Manager goes to page to add new agent > 3) Inputs agent data, including display order number > 4) Manager submits agent info and inserts into db > 5) Next, run a query to get the agents, ordering by display order number > 6) Loop over the query setting the display order number to CurrentRow * 10 > > Does this follow your line of thinking? > > Rick > > -----Original Message----- > From: Josh Nathanson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 14, 2007 12:28 PM > To: CF-Talk > Subject: Re: How to re-order items? > >> How would I use the Round function (or something else?) >> to change the numbers up to the next number evenly >> divisible by 10? > > Hey Rick, > > What I do is, submit the 14 into the db...re-query, ordering by display > order...loop over the query, updating each entry setting displayorder = > #currentRow# * 10. This will re-order everything and put your multiples > of > 10 into the db in the correct order -- you don't have to deal with > handling > the form values and trying to re-order them before entering them into the > db. Let me know if you need more explanation. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:269852 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4