views:

43

answers:

3

I am looking for a drag and drop components implementation for a website similar to http://www.netvibes.com. So the positions of the components should be saved in database. If any one can help me with any javascript or rails tutorial implementation or guidance for this, that will help a lot.

A: 

maybe third party ui-jquery could help you with that

markcial
A: 

for the drag drop feature use jquery-ui

for saving the positions to a database you use jquery ajax

a suggestion. i have not used this. but heard good reviews about it. try jrails for implementing jquery in rails.

ZX12R
A: 
< %= javascript_include_tag :defaults %>



< div id="draggable_id" class="draggable_class"> <br>
                  < img src='image/demo.jpg' style="border:none" alt=""><br>
< /div><br>
< script type="text/javascript"><br>
    new Draggable("draggable_id", { revert: true, ghosting:true });<br>
    Droppables.add('drop_box', { <br>
                    accept: 'draggable_class' <br>
                    hoverclass: 'hover', <br>
                    onDrop: function() {alert("Image dropped"); }<br>
                  }); <br>
< /script>


< div id="drop_box">

< /div>


Now you can drag image demo.jpg to the drop box.This is basic example which may help you.
Salil
Thanks Salil, I got the solution for it and posted a blog about it as well. demo url - http://draggable-app1.heroku.com/homeblog url - http://www.spritle.com/blogs/?p=610
vamsi