Vue.draggable: support for dynamic lists

Created on 17 Aug 2017  路  7Comments  路  Source: SortableJS/Vue.Draggable

I have developed a kanban-style board and run into issues when not using the list property. I don't know what the lists are until run-time since they're dynamically generated based on a status column. I have it generally working using a v-for to build out the swim lanes.

I either need to figure out how to implement this using the list property or have the cancellation support when not using the list property.

Any ideas on either of these approaches?

Most helpful comment

then you will you use a v-for for each group pseudo-code:

<div v-for="list in lists">
    <draggable v-model="list">
          ......
     </draggable>
<div>

All 7 comments

I don't understand the issue: the property list is reactive so if you change it "dynamicly" changes will be reflected.

Hi David, here's a jsfiddle that demonstrates what I'm doing. In the checkMove function, I can't seem to be able to cancel the move. You'll also see that once the item is dropped, it is reverted to its original position. Setting :list to null seems to correct the issue of it reverting back to its original position.

https://jsfiddle.net/ka2gh2wy/

What do tou want to achieve you can't?

You should have 3 draggable element, one for each list.

I guess that's the issue. I don't know if I'll three, five, etc "lists". the lists are not determined until runtime. I need the ability to cancel a move if the move is deemed invalid.

then you will you use a v-for for each group pseudo-code:

<div v-for="list in lists">
    <draggable v-model="list">
          ......
     </draggable>
<div>

This post save my day!

Im using the wrong reference in model!!! and your post helps me to see it

Tnks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathlet0x picture mathlet0x  路  4Comments

Laraveldeep picture Laraveldeep  路  3Comments

AlexandreBonneau picture AlexandreBonneau  路  3Comments

Stetzon picture Stetzon  路  3Comments

rootman picture rootman  路  3Comments