Does anyone know how to allow embedded/nested lists to be sortable if their parent list item is a cancelled list item on a sortable list?
I.E. Preventing the cancel option in jquery sortable from affecting any nested sortable children?
Example HTML:
<ul id="sortable_list">
<li>Item 1</li>
<li class="cancelSortable">Item 2
<ul id="sortable_nestedList">
<li>Nested 1</li>
<li>Nested 2</li>
<li>Nested 3</li>
</ul>
</li>
<li class="cancelSortable">Item 3</li>
<li class="cancelSortable">Item 4</li>
</ul>
You can see from the above code that I only desire (in this instance) the first LI to be sortable within it’s siblings but for those siblings to contain sortable lists. I am using the following JQuery:
$("ul[id^=sortable_]").sortable(
{
cancel: 'li.cancelSortable',
update:
function() {
var result = $(this).sortable('toArray');
alert(result);
}
}
);
The cancel option seems to propogate down to all it’s children too, when I don’t require this. I need to ‘allow’ any cancelled li’s children ul’s.
Any light shed on this would be most gratefully received.