Opened 8 years ago

Closed 4 years ago

#7121 closed feature (wontfix)

Sortable: Document and support the object version of the placeholder option

Reported by: Altreus Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.8.10
Keywords: Cc:
Blocked by: Blocking:

Description

I have used the following hack in order to customise the placeholder that Sortable uses:

$(selector).sortable({
  placeholder: {
    element: function(currentItem) {
    },
    update: function(container,p) {
    }
  }
});

This hack works in all versions of UI since 1.7.2 - the one I'm using. I got the hack from StackOverflow here:

http://stackoverflow.com/questions/2150002/jquery-ui-sortable-how-can-i-change-the-appearance-of-the-placeholder-object

This is actually extremely useful in a variety of situations and I think it should be officially part of the API. I would suggest tweaks to this: the currentItem, for example, is not the ui.item we get in other functions. So, a bit of tweaking of the interface would be needed, but this is so amazingly useful I think it would be worth it.

Change History (5)

comment:1 Changed 7 years ago by Scott González

Milestone: 1.9.02.0.0

comment:2 Changed 7 years ago by Jörn Zaefferer

Status: newopen

Consider for redesign.

comment:3 Changed 6 years ago by tj.vantoll

Summary: Feature request: Make this Sortable placeholder hack part of the APISortable: Document and support the object version of the placeholder option

comment:4 Changed 6 years ago by tj.vantoll

Related to #8133.

comment:5 Changed 4 years ago by Scott González

Resolution: wontfix
Status: openclosed

We shouldn't support custom APIs like this. The placeholder option should just support better input (#4957) and the updates should be done in response to existing events.

Note: See TracTickets for help on using tickets.