Home > Software engineering >  JQuery UI API changed for grabbing data on draggable
JQuery UI API changed for grabbing data on draggable

Time:09-18

I used to be able to grab a draggable data and assign it to another. However it looks like the newest JQuery UI has changed and this currently doesnt work. I am using JQuery UI 1.12.1. What is the new way to do this?

 var draggableData = $(draggle).data('draggable');

  $(draggle).data('draggable', draggableData);

CodePudding user response:

I would suggest the following:

var draggableData = $(dragA).data('ui-draggable');

$(dragB).data('ui-draggable', draggableData);

To retrieve the instance object, call jQuery.data() using the widget's full name as the key.

This should work for you.

  • Related