Skip to main content
September 27, 2011
Question

Where to start with drag and drop to change order of items

  • September 27, 2011
  • 1 reply
  • 4825 views

I have this CMS, different categories. Each category contains several images. People click on the category they want to change and then see all the images. I need to make there a drag and drop system so clients can change order in which items are showed on their website. The order is written to the database.

People say to me, hell you should use AJAX. There are many AJAX versions and exemples and I don't know where to start. I googled on drag drop coldfusion but the more I read the more confused I get. I am no good at javascript and I am sort of panicking. I know though I should find a way to get comfortable with it.

Can you please point me in the right direction, where to start, what method to chose?

Thanks in advance for any help.

    This topic has been closed for replies.

    1 reply

    Owainnorth
    Inspiring
    September 27, 2011

    Drag & drop is a client-side technology, so ColdFusion is of no use whatsoever. This leaves you with the following options:

    Javascript.

    That's it. You'll need a CF webservice of some description if, as you say, you want to save settings to a database but one step at a time eh? To be honest, that's a major undertaking if you don't know what to do. Hell, I've been doing this for years, and I reckon I'd seriously struggle writing something like that.

    Now servers are quicker and so are internet connections, I'd suggest just having up/down hyperlinks under each image, which then refresh the page, call to the database to move that image's priority up or down, then re-display the page. As long as the image titles don't change the browser will keep them cached anyway so the page won't take long to load at all.

    Not perfect I know, but a thousand times easier than what you'd be trying to implement with JS.

    Inspiring
    September 28, 2011

    Drag & drop is a client-side technology, so ColdFusion is of no use whatsoever. This leaves you with the following options:

    Javascript.

    Agree.  And if one is a web developer, one cannot fall back on "I'm no good @ Javascript", because Javascript is not a "nice to have", it's essential.

    Fortunately, Bianca, it sounds like you have an understanding client, so this is the perfect situation to buy a Javascript book and start working through it, using your requirement here as an "end game".

    I'd get to grips with the basics of JS (including writing it in an OO fashion), then get hold of a JQuery book & follow through all that too.

    --

    Adam

    Inspiring
    September 28, 2011

    There are a couple IIRC, there's a "Javascript for Dummies" and a "Javascript & Ajax for Dummies" - go for the former if you're going to go for either. Ajax itself is one of the most misunderstood terms, it always relies on you having a second technology serving up the data - in your case that would be ColdFusion, which clearly a generic book would not cover. Personally as you're already a web developer, I'd skip the "For Dummies" range, you'll not learn all that much as they really do only cover the absolute basics.

    I think I bought this book, which covers not only the basics but goes onto explain OO principles and extremely in-depth stuff as well for when you're ready. It'd be a far safer investment

    In the meantime, jQuery is an extremely good shortcut.


    Owain North wrote:

    [stuff]

    Good advice.

    --

    Adam