Need a way to allow sorting except for last item with in a list.
Tried using the cancel option but it didn't work and I don't think that's what its for.
I think a solution may be with events but would like your take on it.
In practice the list is dynamically generated and relies on tag and relative referencing not id's for selecting.
Sample code:
$("ul").sortable({});
...
<ul>
<li>red</li>
<li>blue</li>
<li>white</li>
<li>black</li>
<li>this li should not be sorted</li>
</ul>
Browser is Internet Explorer 6.
Need a way to allow sorting except for last item with in a list.
Tried using the cancel option but it didn't work and I don't think that's what its for.
I think a solution may be with events but would like your take on it.
In practice the list is dynamically generated and relies on tag and relative referencing not id's for selecting.
Sample code:
$("ul").sortable({});
...
<ul>
<li>red</li>
<li>blue</li>
<li>white</li>
<li>black</li>
<li>this li should not be sorted</li>
</ul>
Browser is Internet Explorer 6.
Share Improve this question edited Dec 25, 2016 at 9:36 chrki 6,3236 gold badges38 silver badges59 bronze badges asked Nov 11, 2008 at 22:23 jason saldojason saldo 9,9505 gold badges35 silver badges41 bronze badges1 Answer
Reset to default 25$("ul").sortable( { items: "> li:not(:last)" } );