Bug Tracker

Ticket #2927 (closed enhancement: worksforme)

Opened 8 months ago

Last modified 8 months ago

Droppable accept option - allow a function

Reported by: pfm102 Assigned to: paul
Type: enhancement Priority: major
Milestone: 1.3 Component: ui
Version: 1.2.5 Keywords: droppable
Cc: pmounce@narrowstep.com Needs: Review

Description

It would be great if the "accept" option to droppable could accept a function instead of a jQuery selector.

That function should have the event and UI arguments (same as drop option).

I want to be able to write quite complex logic for knowing whether the droppable should accept the draggable. For example, when re-ordering a list (where droppables are list-items with a class of "gap", interspersed with the content list-items), I would like to allow ul.gap to accept my draggable, UNLESS the gap is an immediate sibling of where the draggable started.

Attachments

Change History

Changed 8 months ago by flesler

  • keywords set to droppable
  • owner set to paul
  • component changed from core to ui

Changed 8 months ago by scott.gonzal

  • status changed from new to closed
  • resolution set to worksforme

The accept option already supports functions. The function takes one parameter which is the draggable element.

Note: See TracTickets for help on using tickets.