How to lock any item on its position?
Hello!
I use you lib for grouping items in a list. On each item I have switcher - when it's ON group creates and this item must be the first in that group. But when I drag new item onto this group I can put it higher then the first item and replace it with new, that's wrong. How can I do that all new items can only be added below the first one in the group?
Please check the original library's group.put option / property https://github.com/RubaXa/Sortable#group-option. You should use function to decide whether to allow / disallow the adding
Thank you for your answer, but it's not what I need. I'll show you some screenshots, maybe that helps to explain what I want.
This is our grid with tickets. We can group tickets into a block. There is a switcher button on each item, when we switch it ON we create a new block (drop place) and this item must always be the first in it.
When I'm dragging any free item into a new block I can see ghost element - the place where to put new item. Now this ghost item can be above the first item in the block and will replace it after drop. That's what I don't want.

I need all newly pushed elements to be added below the first element and ghost element can be placed only below the first item. Even if I drag it above the first item.

So how can I lock the first item?
Hi @Prontsevich
the block line itself is not a part that needs to be sorted, right?
From my prospective, in your particular case, it is way better to split the whole thing to have a sortable directive for each of the block (and each of the block lines should be above them).
Then, connect the sortable directives using the group option like it is done here https://smnbbrv.github.io/angular-sortablejs-demo/multiple-lists
The fact that it's a table is making it harder I guess but I have no better ideas. Either it could be done by splitting or by group property with a custom function.
answered, no more activity => closing
I am looking into the above example (https://smnbbrv.github.io/angular-sortablejs-demo/multiple-lists). When you start dragging element 4 upwards (very slowly), it becomes sensitive and change position of element 2. Again it becomes normal and only changes element 3. So why is this happening when we start dragging any element. I have seen this behavior on multiple examples. Any solution?
Is there any way we can lock an item at the last position?
I have disabled dragging on a certain element in the list but as explained by @gsinha I am also facing similar issue. Did anyone get the solution for it?