Search and Top Navigation
#5049 closed bug (notabug)
Opened January 07, 2010 06:37PM UTC
Closed October 24, 2012 02:36AM UTC
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
Attachments (0)
Change History (5)
Changed January 07, 2010 06:40PM UTC by comment:1
Changed January 08, 2010 09:43AM UTC by comment:2
Actual
Changed January 15, 2010 10:52AM UTC by comment:3
| component: | ui.core → ui.draggable | 
|---|
That doesn't make sense. Why would you make items in a sortable also draggable?
Changed October 11, 2012 09:07PM UTC by comment:4
| milestone: | TBD → 2.0.0 | 
|---|
Changed October 24, 2012 02:36AM UTC by comment:5
| _comment0: | 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 → 1351046221983273 | 
|---|---|
| resolution: | → notabug | 
| status: | new → closed | 
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
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>