> Hi, > > I am looking for a CF tutorial on how to create a drag and drop list > to reorder entries. > > Thanks!
This is not tested but it should offer an idea of how to get a sort working with jquery. Send me an email offline if you need more help. t...@tonybentley.com Javascript <script> $("#div").sortable({ update : function() {updatePicSort($('#div').sortable('serialize'))} }); function updatePicSort(v){ var id = //whatever identifier; var list = //a comma seperated list var z = new ASort(); z.setHTTPMethod("post"); var SortRet = z.Sort(id,list); } </script> AND THE CFC. Return something that verifies that the update took <cffunction name="Sort" access="remote" > <cfargument name="id" required="yes"> <cfargument name="list" required="yes"> <cfset newlist= ListToArray(list,",")> <cfloop from="1" to="#arraylen(newlist)#" index="x"> <cfquery name="setsort" datasource="data"> update sort set sort = '#x#' where id = '#newlist[x]#' and IDENTIFIER = '#id#' </cfquery> </cfloop> <cfreturn /> </cffunction> on the front end be sure to include both jquery UI and jquery <cfinvoke component="cfc" method="getcats" returnvariable="forsort"> <cfajaxproxy cfc = "cfc" jsclassname = "Sort"> <style> .handle { float:left; margin-right:3px; cursor:move; } </style> <ul id="div"> <cfloop query="forsort"> <cfoutput> <li id="x_#forsort.id#"> <img src="sort.png" class="handle" alt="move" > <a title="#forsort.Name#" >#forsort.Name#</a> </li> </cfoutput> </cfloop> </ul> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321630 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4