Hi all, is there a way to define the containment option for a sortable so that it is a class name instead of an id list? I have a case very similar to the sortable lists demo, the only difference is that I'm adding new list containers dinamically, so either I need to redo the Sortable.create calls for all new elements to include the newly added container, or having someway to have them generically included (like a class name). Is such thing possible? If not, would it cost much to add that option? TIA -- Victor Jalencas <Victor.Jalencas@gmail.com> _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Hi again, after a bit of playing with Behaviour.js, I've been able to dynamically apply the sortability to new elements as well as having this new sortable be added as a new container in the rest of the containers (using document.getElementsBySelector('list-container') as the containment option). When I add a new element, I do it with a partial (I'm doing this with rails) specifying a new layout which just has the content for the layout and a call to Behaviour.apply(). Now, however, I'm noticing that when I drop the element into the container, it just sits there grayed out (i.e., it doesn't snap back to its correct position) until I click again on it, when it ungrays itself and snaps to position. Anyone has noticed this behaviour before? Is it a known effect of using the Behaviour library? In the demo, it doesn't do that. Thanks for any hints Victor On 12/4/05, victor jalencas <victor.jalencas@gmail.com> wrote:> Hi all, > > is there a way to define the containment option for a sortable so > that it is a class name instead of an id list? > I have a case very similar to the sortable lists demo, the only > difference is that I'm adding new list containers dinamically, so > either I need to redo the Sortable.create calls for all new elements > to include the newly added container, or having someway to have them > generically included (like a class name). Is such thing possible? If > not, would it cost much to add that option? > > TIA > > -- > Victor Jalencas <Victor.Jalencas@gmail.com> >-- Victor Jalencas <Victor.Jalencas@gmail.com> _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Well, for the record, I was able to solve this problem. Turned out to be a scoping issue. Thanks to all who wrote Victor On 12/5/05, victor jalencas <victor.jalencas@gmail.com> wrote: [SNIP]> Now, however, I'm noticing that when I drop the element into the > container, it just sits there grayed out (i.e., it doesn't snap back > to its correct position) until I click again on it, when it ungrays > itself and snaps to position. > > Anyone has noticed this behaviour before? Is it a known effect of > using the Behaviour library? In the demo, it doesn't do that. > > Thanks for any hints > > Victor > > On 12/4/05, victor jalencas <victor.jalencas@gmail.com> wrote: > > Hi all, > > > > is there a way to define the containment option for a sortable so > > that it is a class name instead of an id list? > > I have a case very similar to the sortable lists demo, the only > > difference is that I'm adding new list containers dinamically, so > > either I need to redo the Sortable.create calls for all new elements > > to include the newly added container, or having someway to have them > > generically included (like a class name). Is such thing possible? If > > not, would it cost much to add that option?-- Victor Jalencas <Victor.Jalencas@gmail.com> _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs