Little help need with jquery sortable.
I have a nested list like so:
- root
I have managed a work around if anyone is interested....
instead of the over and out options I have used start and end.
start: function(event,ui)
{
$(this).find('li').not(':has(ul)').append('<ul><li></li></ul>');
$(this).sortable('refresh');
} ,
stop: function(event,ui)
{
$(this).find('li:empty').remove();
$(this).find('ul:empty').remove();
$(this).sortable('refresh')
}
If anyone has better solution please please please let us know...
Actually , i don't have the same diposition of list as you , i saw inside an li you can have ul and li !
> <li class="n-2">Academic
> <ul>
> <li class="n-5">Staff</li>
> <li class="n-6">Courses</li>
> </ul>
> </li>
i only got :
<ul id="sortable" class="connectedSortable">
<li id='1' class="ui-state-default"><span> stuff ...</span></li>
<li id='3' class="ui-state-default"><span> stuff ...</span></li>
<ul id="sortable" class="connectedSortable">
<li id='1' class="ui-state-default"><span> stuff ...</span></li>
<ul id="sortable" class="connectedSortable">
<li id='4' class="ui-state-default"><span> stuff ...</span></li>
</ul>
</ul>
<li id='2' class="ui-state-default"><span> stuff ...</span></li>
</ul>
in my jquery function i've got this in start :
start: function(event,ui)
{
$(this).find('li').next().not('ul').after('<ul id="sortable" class="connectedSortable"><li class="hiddenli" style="height:0.1em;"></li></ul>');
$(this).sortable('refresh');
}
So i manage your version to work with my list^^ , but i get i also get a droppable zone after my current element i'm dragging, so i can placemy li as children but since the parent is the element which i'm dragging, it's not possible i'd like to remove the
For the update on sort i tried and failed using serialize don't know how to get the question and it's children and order it correctly i don't know where my