Problem with nestedSortable


I have a problem to get the target item of a list.
When i'am dropping Item 4 between Sub Item 1.1 and Sub Item 1.2 then it works.

In this case act_parent_ol = ol_2 and act_item = list_9

When dropping on top of Sub Item 1.1 (to create a new ol level) than act_parent_ol is empty ...

How can i get the li-item on wich i have droped another ???
I hope anyone can help ...


Here is my ol.sortable ..

			disableNesting: 'no-nest',
			forcePlaceholderSize: true,
			handle: 'div',
			helper:	'clone',
			items: 'li',
			maxLevels: 5,
			opacity: .6,
			placeholder: 'placeholder',
			revert: 250,
			tabSize: 25,
			tolerance: 'pointer',
			toleranceElement: '> div', 
			update: function(event, ui) 

				var act_parent_ol = ui.item.closest('ol').attr('id');
				var act_item = $(this).data().sortable.currentItem.attr("id");

Open in new window

And here is my list
	<ol class="sortable" id="ol_1">
		<li id="list_1"><div>Item 1</div>
			<ol id="ol_2">
				<li id="list_2"><div>Sub Item 1.1</div>
				<li id="list_3"><div>Sub Item 1.2</div>
		<li id="list_4" class="no-nest"><div>Item 2 (no-nesting)</div>
		<li id="list_5"><div>Item 3</div>
			<ol id="ol_3">
				<li id="list_6" class="no-nest"><div>Sub Item 3.1 (no-nesting)</div>
				<li id="list_7"><div>Sub Item 3.2</div>
					<ol id="ol_4">
						<li id="list_8"><div>Sub Item 3.2.1</div>
		<li id="list_9"><div>Item 4</div>
		<li id="list_10"><div>Item 5</div>

Open in new window

Klaus TalkenbergerAsked:
Who is Participating?
Klaus TalkenbergerAuthor Commented:
problem is solved ...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.