iamapinan / nestedsortables

Automatically exported from code.google.com/p/nestedsortables
GNU General Public License v2.0
0 stars 0 forks source link

Structure not maintained when injecting dynamic content #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an empty ul list and apply so the netstedsortable
2. Inject content into the list via jquery append
3. Use SortableAddItem() from the Interface-Sortable plugin
4. Attempt to nest any item.
5. Inspect the elements 

What is the expected output? What do you see instead?
I would expect to see a nested item. Instead, I see the following structure:

<li id="1" class="sortitem">
<div class="page-item">
<li id="2" class="sortitem" style="position: static; display: block; left:
23px; top: -1px;">
<div class="page-item">
<span class="dragHandle" style="-moz-user-select: none;"/>
<span id="editStyle" class="editStyle editableItem2">Type Here...</span>
</div>
</li>
<span class="dragHandle" style="-moz-user-select: none;"/>
<span id="editStyle" class="editStyle editableItem1">Type Here...</span>
</div>
</li>

There seem to be 2 issues.
1. No nested <ul> element is created
2. The nested item occurs inside a div (which contains the row content and
drag handle), instead of the top nesting element.

What version of the product are you using? On what operating system?
NestedSortable - Version 1.0.1
jQuery 1.2.6
Interface 1.2

Please provide any additional information below.

Is there a working method of injecting dynamic content into the
nestedsortable list?

Original issue reported on code.google.com by nbar...@gmail.com on 6 Nov 2008 at 7:07

GoogleCodeExporter commented 9 years ago
In regard to your first step, I independently noticed that I couldn't drag 
anything into a nested sortable list unless 
it had an element to begin with.  As for dynamically added content, I had to 
reinitialize the nested sortable call 
after every element was added, as you would need to do for any dynamically 
added elements that you want to be 
affected by jquery plugins.  A known circumvention to the dynamic content issue 
is to put it within a containing 
element, and then you watch for action on that container.  If you have upgrade 
to jQuery 1.3, you could try the 
live events plugin - http://docs.jquery.com/Events/live .

Original comment by buf...@gmail.com on 22 Sep 2009 at 3:48