The callback called after you drop your sorted item should place an ajax
call to your selected endpoint with a list of IDs in their new order. (I
haven't used the jQuery UI sortables to know the details.)
Then on the CF side just update the DB. A naive way might be like this:
<cfloop from="1" to="#listLen(IDs)#" index="i">
UPDATE items
SET sortOrder = <cfqueryparam value="#i#"
CFSQLType="cf_sql_integer" />
WHERE (ID = <cfqueryparam value="#listGetAt(IDs, i)#"
CFSQLType="cf_sql_idstamp" />)
</cfloop>
On 9/25/13 4:42 PM, [email protected] [email protected] wrote:
> I have a cfm page that displays a drag and drop ul list and I do not know how
> to create an array of that sorted list to the mysql database.
> Any help would be greatly appreciated. I am new to the jquery, jquery-ui
> plugins, but loving it all so far.
>
> Thanks in advance,
> Terry
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356844
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm