View Single Post
Old 06-10-2009, 06:30 PM   PM User | #1
loki421
Regular Coder

 
Join Date: Feb 2009
Location: Worcester
Posts: 172
Thanks: 13
Thanked 6 Times in 6 Posts
loki421 is an unknown quantity at this point
Can I reorder a list in Flex and have it reflect in the db?

Hi all,

Bit of a tricky one here for me, let''s say i have a database with 5 entries, with a column called 'priority' which is set to numeric with values 1 - 5, and when i query the database i order them asc, ie:

Code:
<cfquery name="q" datasource="#dsn#">
SELECT priority
FROM myDataBase
ORDER BY priority asc
</cfquery>
I then show these items in a List control in Flex, now what i'm trying to do is develop something where i can reorder these in the database, ie changing the priority number.

I've tried using a drag and drop into another list control to reorder them, and that's fine visually, but how would i send that ordered list into the database?

Another thought i had was perhaps to have move up/down buttons, so that when an item is selected in the List control, it would grab the ID and priority from the database, then preform a calculation (don't know what) to +/- 1 from the priority, but it's a bit much for me to work out on my own, and also how would the others in the database get re-arranged?

Does anyone here have any experiance with this sort of thing or could someone point me in the right direction for a good tutorial on something simular? Any help would be gratefully appreciated!

Many thanks in advance all!

Last edited by loki421; 06-10-2009 at 06:32 PM..
loki421 is offline   Reply With Quote