Rick F or anyone else who is interested: I just put up a quick working demo of CF using jQuery with the Interface Sortable and Draggable Plugins. The demo saves the serialized sorted list into a mySql database. Included on the demo page is a link to the complete .cfm code
You can further optimize the code by going straight to an ajax post. (I only did it "the long way" just to mimic what I have mentioned to Rick earlier in this thread.) Goto: http://www.365labs.net/cf_jquery/interface/form_sort.cfm Have fun, Michael > -----Original Message----- > From: Josh Nathanson [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 15, 2007 9:32 AM > To: CF-Talk > Subject: Re: How to re-order items? > > Hi Rick, > > You don't want to add 10, you want to multiply by 10. So you are looping > the data: > > <cfoutput query="getAgents"> > > Your cfquery would look like > > UPDATE AgentsTable > SET displayorder = #currentRow# * 10 > WHERE AgentID = #AgentID# > > </cfoutput> > > This will insert 10, 20, 30 etc. as the display order. > > -- Josh> > > ----- Original Message ----- > From: "Rick Faircloth" <[EMAIL PROTECTED]> > To: "CF-Talk" <[email protected]> > Sent: Wednesday, February 14, 2007 7:47 PM > Subject: RE: How to re-order items? > > > > That sounds like the approach I'm currently using in principle, > > I'm just doing the "insert correct number here" approach. > > > > Two questions... > > > > 1) For my approach, I can't figure out how to loop the query, > > assign the CurrentRow value to the Display_Order number, > > then add 10 that number. My loops aren't changing the Display_Order > > number. > > Suggestions? > > > > 2) For your approach, want to share the js solution? I'm not much of > > a javascript coder, but perhaps it's doable... > > > > Thanks for the feedback, Dennis. > > > > Rick > > > > -----Original Message----- > > From: Dennis Powers [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, February 14, 2007 6:00 PM > > To: CF-Talk > > Subject: RE: How to re-order items? > > > >>> the best approach to ordering the display of Real Estate agents > > > > In just about all the applications we develop where sort order is > required > > I > > supply a "sort" field which is a numeric (int) field in the table. I > > create > > a page that retrieves the records to be sorted and displays the relevant > > part of the records ie: picture name, product name ...etc in a form > select > > box. then use a javascript routine to allow them to click on an item and > > move the items up or down in the order. The form gets submitted and the > > result page gets a list of ID's in sorted order. I loop through the ID's > > incrementing a counter and update the sort field for each ID with the > > counter. > > > > This gives the user full visual control without the "insert" correct > > number > > here problem. > > > > > > > > Best Regards, > > > > Dennis Powers > > UXB Internet - A website design and Hosting Company > > 690 Wolcott Road > > P.O. Box 6029 > > Wolcott, CT 06716 > > Tel: (203)879-2844 > > http://www.uxbinternet.com/ > > http://www.uxb.net/ > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270042 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

