Re: [Proto-Scripty] Limit number of draggables
Hey Jason, First of all THANK YOU for the reply! I've been trying all weekend to sort this out. So, I have this page... http://wipeasthma.com/diagnosis.php Pretty obvious right away what I'm trying to do. I've hacked this together so far http://wipeasthma.com/drag_drop.php The left hand droppable is a sortable but what I need are 4 to 8 individual targets that can only hold one draggable at a time, but still allow the user to move them from 'slot' to 'slot', or to allow them to put them back in the column on the right. If they try to drag another draggable onto an occupied space it would just revert back to the right column. Make sense? I REALLY appreciate your time. Thanks, Jeff On Monday, February 25, 2013 2:03:39 PM UTC-5, Jason wrote: > > > I don't have an example right now but I can tell you how I do it > > When I want just one draggable to be dropped - I destroy the draggable > after the drop happens or hide the dropzone and show a "filled" element so > that the user knows that there is something in it > > I can dig up an example later if you need one > > Jason Westbrook | T: 313-799-3770 | jwest...@gmail.com > > > On Mon, Feb 25, 2013 at 7:29 AM, Jeff Hight > > wrote: > >> Could someone shoot me a quick example of how to limit the number of >> draggables a droppable can contain to just one? >> >> Thanks! >> >> jH >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Prototype & script.aculo.us" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to prototype-scriptaculous+unsubscr...@googlegroups.com >> . >> To post to this group, send email to >> prototype-s...@googlegroups.com >> . >> Visit this group at >> http://groups.google.com/group/prototype-scriptaculous?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Limit number of draggables
I don't have an example right now but I can tell you how I do it When I want just one draggable to be dropped - I destroy the draggable after the drop happens or hide the dropzone and show a "filled" element so that the user knows that there is something in it I can dig up an example later if you need one Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com On Mon, Feb 25, 2013 at 7:29 AM, Jeff Hight wrote: > Could someone shoot me a quick example of how to limit the number of > draggables a droppable can contain to just one? > > Thanks! > > jH > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to prototype-scriptaculous+unsubscr...@googlegroups.com. > To post to this group, send email to > prototype-scriptaculous@googlegroups.com. > Visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To unsubscribe from this group and stop receiving emails from it, send an email to prototype-scriptaculous+unsubscr...@googlegroups.com. To post to this group, send email to prototype-scriptaculous@googlegroups.com. Visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Proto-Scripty] Limit number of draggables allowed in a droppable
If i recall correctly there is an onDrop function that you can call when initialising the droppable... So what i would do is ondrop count the elements with the classname that are inside the droppable... or even easier .. ondrop update a hidden element on the page to the value of the number of dropped elemenets in it and ondrop also check that hidden value and not let it drop if its more than 1 Both will work HTH Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "Jason Whitmer" To: "Prototype & script.aculo.us" Sent: Thursday, November 19, 2009 9:45 PM Subject: [Proto-Scripty] Limit number of draggables allowed in a droppable > How do I limit a Droppable to contain only 1 Draggable? > > I have a Droppable: > > > Description > > > And a Draggable: > > > DRAG ME > > > Which I setup like this: > > Droppables.add('myDroppable'); > > new Draggable('myDraggable'); > > > Thank you, > Jason > > -- > > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to > prototype-scriptacul...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/prototype-scriptaculous?hl=. > > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptacul...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=.