Opened 14 years ago

Closed 11 years ago

#5049 closed bug (notabug)

a(this).data("draggable") is undefined

Reported by: satels Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.draggable Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

This code does not work

<script type="text/javascript">
$(function () {

	$(".task").draggable({
		connectToSortable: "#tasks_list"
	});

	$(".tasks_list").sortable({});

});
</script>


<ul class="tasks_list">
	<li>
		<div class="task">Task 1</div>
	</li>
	<li>
		<div class="task">Task 2</div>
	</li>
	<li>
		<div class="task">Task 3</div>
	</li>
</ul>

How to fix this error?

a(this).data("draggable") is undefined

Change History (5)

comment:1 in reply to:  description Changed 14 years ago by satels

Sorry,

<script type="text/javascript">
$(function () {

	$(".task").draggable({
		connectToSortable: ".tasks_list"
	});

	$(".tasks_list").sortable({});

});
</script>

<ul class="tasks_list">
	<li>
		<div class="task">Task 1</div>
	</li>
	<li>
		<div class="task">Task 2</div>
	</li>
	<li>
		<div class="task">Task 3</div>
	</li>
</ul>

comment:2 Changed 14 years ago by satels

Actual

comment:3 Changed 14 years ago by Jörn Zaefferer

Component: ui.coreui.draggable

That doesn't make sense. Why would you make items in a sortable also draggable?

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

Milestone: TBD2.0.0

comment:5 Changed 11 years ago by mikesherov

Resolution: notabug
Status: newclosed

Thanks for contributing, however this is not a bug. Draggable and Sortable are not intended to be used on the same set of elements. For valid uses of connecting draggables to sortables, see here: http://jqueryui.com/draggable/#sortable

Last edited 11 years ago by mikesherov (previous) (diff)
Note: See TracTickets for help on using tickets.