Drag and Drop Between Lists |
[eluser]bennyhill[/eluser]
I am trying to make a simple table reservation app. The user will see a list of guests (populated by a database query), and then another blank list representing the table. I want to make it so the user can drag and drop up to ten names into the second list, then click submit to enter it into the database. The thing I am stuck on is not the PHP or CodeIgniter but the drag and drop part. Will I have to use a javascript library? What exactly happens when the name is dropped into the second list, is it adding the values to a javascript array? If so, how would I get that array from javascript to PHP and MySQL? It doesn't have to be drag and drop. It can be a basic two list component with add remove buttons. Im just not that good in javascript.
[eluser]pixelazion[/eluser]
@bennyhill you can try this link: http://www.ikawka.com/2008/09/dagsort-wi...s/#content you'll need prototype.js and scriptaculous for this one
[eluser]Jay Turley[/eluser]
Well, just so it doesn't feel left out, I feel compelled to mention jQuery and it's own brand of draggy-droppyness: the jQuery ui drag and drop modules. You'll have to download the core and Draggable modules.
[eluser]xwero[/eluser]
jQuery UI sortable demo and documentation Your code will look like this Code: $("#myList").sortable({ Edit : Jay beat me ![]()
[eluser]got 2 doodle[/eluser]
I'm trying to learn some javascript and specifically the mootools library There is are some fantastic tutorials here This one is about sortables mootools sortables tutorial This one is on drag and drop mootools drag and drop |
Welcome Guest, Not a member yet? Register Sign In |