[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problem with nestedSortable

Posted on 2012-09-10
1
Medium Priority
?
780 Views
Last Modified: 2012-09-13
Hello

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 ...

thanx

Here is my ol.sortable ..

		$('ol.sortable').nestedSortable({
			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>
			</ol>
		<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>
					</ol>
			</ol>
		<li id="list_9"><div>Item 4</div>
		<li id="list_10"><div>Item 5</div>
	</ol>

Open in new window

0
Comment
Question by:Klaus Talkenberger
1 Comment
 

Accepted Solution

by:
Klaus Talkenberger earned 0 total points
ID: 38394211
problem is solved ...

thanx
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

831 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