Skip to main content

Search and Top Navigation

#3874 open feature ()

Opened January 20, 2009 01:24AM UTC

Last modified November 05, 2012 10:58AM UTC

Restrict certain drops by pre-defined rule or callback

Reported by: javaJake Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

I've tried to transition over from NestedSortables to Sortable in jQuery UI, since NestedSortables depends on deprecated jQuery functionality. However, I have been unable to adapt my code in a simple, clean fashion to Sortable.

Here's my scenario: I currently have two lists: categories and links. Categories may only contain links, and links may not contain anything at all. Now, the "links may not contain anything" rule is easy to implement - merely make sure that all links are list items, and not lists, and Sortable will not try to nest anything beneath it. However, categories, because they are lists, may contain anything you throw at them.

I would like to be able to tell Sortable which lists are able to contain which items. If you wanted to allow for an even wilder set of rules (such as seen here: <http://markmail.org/message/63qx5pvptvnrzdcm>) you could instead listen to the return value of any callbacks assigned via .sortable({}) to decide whether or not to cancel the sort, or do some other action.

Attachments (0)
Change History (3)

Changed May 07, 2009 12:54PM UTC by jzaefferer comment:1

milestone: TBD1.next

Changed October 03, 2012 04:51PM UTC by scottgonzalez comment:2

milestone: 1.next2.0.0

Changed November 05, 2012 10:58AM UTC by jzaefferer comment:3

status: newopen

Consider for redesign. Accept/restrict should be easy to customize with a callback.