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.
views:
43answers:
3
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
2010-03-19 12:59:54
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
2010-03-30 11:15:04
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
2010-03-31 18:55:13