1

guys! I have a problem. I need to initialize my sortable() with items 'li:not(.someclass)'. If I set:

$('ul').sortable({ items: 'li:not(.someclass)' });

everything works fine. But if I try:

$('ul').sortable().sortable('option', 'items', 'li:not(.someclass)');

It doesn't work. Why option 'items' exists if it doesn't work correctly or what is correct way to set up items through options?

Try examples here.

1 Answer 1

1

You can use cancel (Couldn't get items working) - Demo

$('ul').sortable();
$("ul").sortable("option", 'cancel', 'ul > li.last');
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot. Everything is fine! Is any way to set items, not cancel (in general case)?
I tried it also, but doesnt seem to work. probably need to check its an issue. Cause i see multiple threads on it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.