Problem with nestedSortable

Posted on 2012-09-10
Last Modified: 2012-09-13

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

Question by:Talki
    1 Comment

    Accepted Solution

    problem is solved ...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now