Wednesday, April 6, 2011

drag and drop using javascript

Hi All,

I have some items in panel A along with some descriptions like time of delivery. All items in different div. In the second panel I have list of drivers with different timings like 9AM, 10AM and so on.

Now I need, that, when I drag and drop itemA from Panel1 to DriverA in panel2, I want that the item shoud be added to the dropped driver(DriverA) and the the cell of that particular driver with timing (say if item has to be delivered at 10AM , then then cell of driver with 10 AM changes the color to red).

I need all this to be done with javascript. Please help, urgent.

Thanks & Regards Khushi

From stackoverflow
  • There is support in jQuery for drag and drop.

    See http://www.codeproject.com/KB/webforms/JQueryPersistantDragDrop.aspx and the documentation of jQuery.

  • Do this with a JavaScript framework like jQuery together with an AJAX framework like Prototype.

    Make the Elements droppable with jQuery: http://jqueryui.com/demos/droppable/

    Then store the information with an AJAX call using Prototype and the callback functions of the jQuery methods.

    DanSingerman : Isn't using jQuery alone a simpler/better solution? What are the advantages of introducing prototype as well?
    Lennart : Can jQuery do the AJAX calls as easy as Prototype?
    DanSingerman : I use jQuery a lot for Ajax. I don't see any problem with it.
    Lennart : Ah. Okay. :) Then Kuhshi can skip Prototype. ;) Thank you!
    Natrium : and so can you :-) Long live jQuery! :-)
    DanSingerman : @Natrium haha. jQuery is truly stupendous. John Resig is a genius

0 comments:

Post a Comment