Search code examples
jqueryjquery-ui-tabs

Adding unsortable element to the end of a sortable list


I need to add an element to the end of a sortable list, e.g. I need to add an extra li.

This Li cannot be sortable and must at all times stick to the end of the sortable list. Just like in firefox tabs (there is a + tab at the end).

Any idea how I can achieve this.

Thank you.


Solution

  • Add a class of some sort to that li ('nosort' or something similar) then when you're defining the sortable add the following option:

    cancel: '.nosort',
    

    This will prevent it from being draggable.