Downloadable from here is a version 0.02 of the SLLists class I put together (mentioned in the previous post). This includes a generic PHP script that will:
- Load data from a database
- Display it in a chosen format on the page
- Allow the user to drag and drop the individual records to change the order
- Click save to persist the changes in the database
To use this all you really need to do is setup the database login properties, choose a table, and choose which fields contain the primary key, the displayable text, and the actual sort order.
That’s it!
September 21st, 2005 at 2:18 pm
superb!
stumbled across this when trying to replicate the ‘easy’ interfaces of the likes of lovefilm.com and the online blockbuster.co.uk’s user manageable lists.
simple, well commented code. just what I was after. not much experience with java before so welcomed not having to deal with it.
ordered a book on AJAX from amazon as a result of finding all this. you’ve revitalised an old man’s enthusiasm for the web and where it’s going and I thank you for it.
ta very much
bigred
P.S. have you thought about showing the DVD rental sites this idea?
September 22nd, 2005 at 1:47 pm
Very nice! It works great!
October 19th, 2005 at 6:45 am
Hi Greg! Have you seen the AJAX autocompletion demo (http://script.aculo.us/demos/ajax/autocompleter) from the Script.aculo.us?
I’m trying to work on a PHP version of it, but I just can’t understand how the pop up menu is fed… in the code generated I can see this:
new Ajax.Autocompleter(’contact_name’, ‘contact_name_auto_complete’, ‘/demos/ajax/auto_complete_for_contact_name’, {})
The parameter “/demos/ajax/auto_complete_for_contact_name” should be an Array, but it’s a relative path to (I guess) a cookie…
Could you please give-me some help??
thank you a lot!!
October 19th, 2005 at 8:34 am
I have no idea on the autocompletion stuff - I stuck with the easiest thing - just sorting lists
November 4th, 2005 at 8:13 am
is it possible to make one item on the list not draggable?
November 11th, 2005 at 10:42 am
Hi Greg,
Great job on this little AJAX example.
If you have some more bandwidth right now, would like to talk to you about helping us out in an ajaex-based webdev project. I am based in SF bay. Pls email me back if you are interested!
Again, good job and keep up the good work!
February 7th, 2006 at 1:56 am
Hi Greg,
This is good stuff. I am looking to move items across different containers. For instance drag an item from one container and drop it onto another. Any suggestions , guideline would be appreciated. Thanks in advance.
February 16th, 2006 at 2:58 pm
You don’t seem to have an e-mail published on the site. How does one get in touch with you? I have a simple Q. about your great script.
March 9th, 2006 at 11:23 pm
I’ve put up a new example (see my new post) that shows dragging and dropping between groups…
June 27th, 2006 at 10:31 am
Check out http://www.planjam.com/date.php
The site does an excellent job with many aspects of the script.aculo.us library. Even uses Greg’s lightbox effects.
January 30th, 2007 at 1:48 pm
Thanks for this, the dragging and dropping is realy easy..
March 30th, 2007 at 3:37 am
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in testSortable.php on line 75
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in testSortable.php on line 78
What am I doing wrong??
March 30th, 2007 at 4:01 am
forgot to say i have 3 more fields (varchar255) in my db table. why does this stop the script from working and is there a workaround?
Oh yeah and of course thanks for this wonderful script!
July 10th, 2007 at 8:00 am
Hi!
Thanks for some great code. I’ve got a question though. I’m doing the ImageFloat-thingy and it all works just fine. My only problem now is that I want to have a link below each image and I’ve been trying to figure out how to do that. I tried adding a to the beginning of the $listItemFormat variable (and a at the end of course), but when I did that the images were still draggable but not “sortable”. Am I making sense here? Do you have any idea how to solve this?
Thanks in advance
November 7th, 2007 at 6:31 pm
Hi i love the code. A question is there anyway to pass in the element of the list that you are dragging. I.e
if i grab element 3 in the list is there anyway on the onupdate function for me to pass in that id so i can check attributes of just that element?
December 22nd, 2007 at 4:02 am
Thanks for sharing this. Let me try to translate this to JSP. …