{"action":"created","issue":{"url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/728","repository_url":"https://api.github.com/repos/valor-software/ng2-dragula","labels_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/728/labels{/name}","comments_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/728/comments","events_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/728/events","html_url":"https://github.com/valor-software/ng2-dragula/issues/728","id":232009547,"number":728,"title":"\"advanced\" implementation/usage: one side sorting, copying and switching dragged item content/template.","user":{"login":"Caroga","id":4005934,"avatar_url":"https://avatars0.githubusercontent.com/u/4005934?v=4","gravatar_id":"","url":"https://api.github.com/users/Caroga","html_url":"https://github.com/Caroga","followers_url":"https://api.github.com/users/Caroga/followers","following_url":"https://api.github.com/users/Caroga/following{/other_user}","gists_url":"https://api.github.com/users/Caroga/gists{/gist_id}","starred_url":"https://api.github.com/users/Caroga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Caroga/subscriptions","organizations_url":"https://api.github.com/users/Caroga/orgs","repos_url":"https://api.github.com/users/Caroga/repos","events_url":"https://api.github.com/users/Caroga/events{/privacy}","received_events_url":"https://api.github.com/users/Caroga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-05-29T12:27:37Z","updated_at":"2018-03-01T13:58:25Z","closed_at":null,"author_association":"NONE","body":"I've managed to get the drag and drop to work to only drop from one side to the other, but sorting is being cancelled out. I wish to be able to keep sorting on one side (target side) and not on the other side (source side).\r\n\r\nAlso, I wish to replace the HTMLElement with a different template when being dropped, and even better: while being dropped as well.\r\n\r\nI find the documentation to be lacking clear use cases and would love to see how this could be done, and what I should be using.\r\n\r\nThis is my code so far:\r\n\r\n``` typescript\r\nimport {Component} from \"@angular/core\";\r\nimport {DragulaService} from \"ng2-dragula\";\r\nimport {DragAndDropHelper} from \"../../../helpers/DragAndDropHelper\";\r\n\r\n@Component({\r\n    selector: 'app-segment-dropzone',\r\n    templateUrl: './segment-dropzone.component.html',\r\n    styleUrls: ['./segment-dropzone.component.scss']\r\n})\r\nexport class SegmentDropzoneComponent {\r\n    constructor(private dragulaService: DragulaService) {\r\n        dragulaService.setOptions('elements-bag', {\r\n            copy: true,\r\n            copySortSource: true,\r\n            accepts: function (el, target, source, sibling) {\r\n                return target.id === 'elements-dropzone';\r\n            },\r\n        });\r\n        dragulaService.drag.subscribe((value) => {\r\n            this.getElementView(DragAndDropHelper.getElementIdFromDraggedItem(value[1]));\r\n        });\r\n    }\r\n\r\n    public getElementView(elementId: string) {\r\n        console.log(elementId);\r\n    }\r\n}\r\n```\r\n`target html`\r\n\r\n``` html\r\n<div class=\"row\">\r\n    <div class=\"col-lg-12\">\r\n        <ul [dragula]='\"elements-bag\"' id=\"elements-dropzone\">\r\n            <li>first item</li>\r\n            <li>second item</li>\r\n        </ul>\r\n    </div>\r\n</div>\r\n```\r\n`source html`\r\n\r\n``` html\r\n<div class=\"mt-list-container list-simple\">\r\n    <ul [dragula]='\"elements-bag\"' id=\"elements-list\">\r\n        <li class=\"mt-list-item\" *ngFor=\"let element of elements\" [attr.data-element-id]=\"element.id\" >\r\n            <div class=\"list-icon-container done\">\r\n                <i class=\"icon-check\"></i>\r\n            </div>\r\n            <div class=\"list-datetime\">{{ element.type }}</div>\r\n            <div class=\"list-item-content\">\r\n                <h3 class=\"\">{{ element.name }}</h3>\r\n            </div>\r\n        </li>\r\n    </ul>\r\n</div>\r\n```\r\n\r\nGoal in short: \r\n\r\n1). drag and drop only from the right to the left side: done, is done using accept property. \r\n2). Allow sorting on the left side (target side, id=\"elements-dropzone\") only. Not on the right side! \r\n3). Change element template ~~while being dragged and~~ after being dropped.\r\n\r\nWould love to see any pointers on this. Thank you very much."},"comment":{"url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/comments/369599302","html_url":"https://github.com/valor-software/ng2-dragula/issues/728#issuecomment-369599302","issue_url":"https://api.github.com/repos/valor-software/ng2-dragula/issues/728","id":369599302,"user":{"login":"inv-senchuthomas","id":23400923,"avatar_url":"https://avatars0.githubusercontent.com/u/23400923?v=4","gravatar_id":"","url":"https://api.github.com/users/inv-senchuthomas","html_url":"https://github.com/inv-senchuthomas","followers_url":"https://api.github.com/users/inv-senchuthomas/followers","following_url":"https://api.github.com/users/inv-senchuthomas/following{/other_user}","gists_url":"https://api.github.com/users/inv-senchuthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/inv-senchuthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inv-senchuthomas/subscriptions","organizations_url":"https://api.github.com/users/inv-senchuthomas/orgs","repos_url":"https://api.github.com/users/inv-senchuthomas/repos","events_url":"https://api.github.com/users/inv-senchuthomas/events{/privacy}","received_events_url":"https://api.github.com/users/inv-senchuthomas/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T13:58:25Z","updated_at":"2018-03-01T13:58:25Z","author_association":"NONE","body":"@Caroga  whether it possible to delete  multiple items from the dropzone by pressing the ctrl key and selecting the items. And if they dragged out of the area we need to ask for confirmation to delete if it confirmed multiple items need to be deleted other ways the action should be rolled back"}}
{"actor":{"display_login":"inv-senchuthomas"}}