First off, thanks for your work on this very helpful component! And secondly, please forgive my ignorance if this is an easy answer.
I would like to include an element within the draggable component that is completely ignored and unsortable. Since draggable wraps the sortable elements I need to put my extra element within <draggable> in order to lay out the page properly. However, I'm finding that including the element is messing with the sorting order.
<draggable :list="albums"
element="div"
:options="{filter: '#createAlbum'}"
>
<div v-for="album in albums"
is="AlbumCreatorAlbum"
:album="album"
></div>// Sortable elements
<add-album></add-album> // My custom element that I want at the end of the draggable list and should not sort
</draggable>
Is this currently possible? I'd appreciate any insight you may offer! Thank you 👍
Hello @gibson, you should try draggable option
Something like this:
<draggable :list="albums"
element="div"
:options="{draggable : '.creator'}">
<div v-for="album in albums" class="creator"
is="AlbumCreatorAlbum"
:album="album"></div>
// Sortable elements
<add-album></add-album>
// My custom element that I want at the end of the draggable list and should not sort
</draggable>
@gibson , Did this tip work for you?
I think you are talking to me, right? :-)
I think I need to try replicating this in a fiddle in order to show what was happening... but I used both the filter and draggable options, which did make the <add-album> sit at the end of the list, however, its presence seemed to mess up the :list in draggable.
When I would inspect albums after sorting, they would be out of order from what the dom was showing.
Let me build a fiddle and get back to you. Thanks for following up!
@David-Desmaisons I was able to replicate the problem here: https://jsfiddle.net/tgjvzwvn/1/
Thanks for taking a look! 👍
HI @David-Desmaisons i have 4 type status wise block , but from block1 it can go to block 2 but can'nt go to block 3 or fourth , how i can stop the drop event as well as darg item to his original array.
Any help will be appreciated
@jschutt , I play around with your jsfiddle and I was able to reproduce the problem.
It seems that the work-around I proposed is not working.
I don't think I can do something because it is due to the way Vue is rendering v-for element.
So as a work-arround:
1) Keep the add element out-side the draggable component (you will have to ajust you css but it should be the easiest and most straigthp-forward solution )
<draggable :list="albums"
element="div"
:options="{draggable : '.creator'}">
<div v-for="album in albums" class="creator"
is="AlbumCreatorAlbum"
:album="album"></div>
</draggable>
<add-album></add-album>
2) Use "is" to have the add-album as in the v-for loop:
<draggable :list="albumsAndAdd"
element="div"
:options="{draggable : '.creator'}">
<div v-for="album in albumsAndAdd" class="creator"
:is="album.type"
:album="album.album"></div>
</draggable>
where albumsAndAdd will contains album and a element at the representing the add behaviour
@sunilkumarverma , create a new issue with jsfidlle and complete descroption of your problem that is not related to this issue.
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<section class="content">
<h4 class="text-center">PO Profile</h4>
import draggable from 'vuedraggable'
export default {
data(){
return{
taskObject:{
taskId:'',
taskStatus:'',
},
}
},
created: function(){
this.projectRequestId = this.$route.params.projectRequestId;
},
components:{
draggable
},
computed: {
getBackLogList: function(){
var app = this;
return app.$store.state.backlogList;
},
getWorkInProgress: function(){
var app =this;
return app.$store.state.workInProgressList;
},
getPendingApproval: function(){
var app =this;
return app.$store.state.pendingApprovalList;
},
getDoneTasks: function(){
var app =this;
return app.$store.state.completedList;
},
},
hii this is my code so basically here i have four status ->
1.ASSIGNED
2.WORK_IN_PROGRESS
3.COMPLETED_BY_DEVELOPER
4.VERIFIED_BY_PM
-> so if status is ASSIGNED then he can drag this card to 2nd block which represent WORK_IN_PROGRESS
->if it is WORK_IN_PROGRESS which is second block then he can drag to first block means in ASSIGNED status or in 3rd block that is COMPLETED_BY_DEVELOPER status but not directly to 4th block which is VERIFIED_BY_PM
so basically when i dropping the card(draggable element) i want @add method is triggering so that time according to status i can allow to happen drop event or else i should be able to cancel the drag & drop event.
Any help will be really appreciated,
thanks in advance
@sunilkumarverma , please as mentioned before:
1) Create a NEW ISSUE on github, this thread is becoming messy mixing different topics
2) Create a jsfiddle (copy-pasting code is not helping)
3) Provide a scenario explaining what you want to achieve
hii
Can you just tell me the how to delete or clear total store data when user
is logout.
On Wed, May 17, 2017 at 1:43 PM, David Desmaisons notifications@github.com
wrote:
@sunilkumarverma https://github.com/sunilkumarverma , please as
mentioned before:
- Create a NEW ISSUE on github, this thread is becoming messy mixing
different topics- Create a jsfiddle (copy-pasting code is not helping)
- Provide a scenario explaining what you want to achieve
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/SortableJS/Vue.Draggable/issues/143#issuecomment-302018754,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQDeoZ5dc-kcBspN-qqdgoad16K-wi0Vks5r6qwjgaJpZM4NVdvu
.
--
Thanks & Regards
Sunil Kumar Verma
Most helpful comment
Hello @gibson, you should try draggable option
Something like this: