drag-and-drop

Angular material sorting near drag & drop

旧巷老猫 提交于 2020-03-25 12:33:02
问题 I successful implemented sorting and drag & drop, but there fun begins. I need both of them in one list. At this moment it working like ... i can sort (it's ok), i can drag (it's ok) but i can't drop, every time it going back to first position. <table cdkDropList matSort (cdkDropListDropped)="drop($event)" (matSortChange)="sortData($event)"> <tr> <th mat-sort-header="name">Name</th> </tr> <tr *ngFor="let element of sortedData" cdkDrag> <td>{{element.name}}</td> </tr> </table> This is a part

IE 10 drag and drop upload gives empty dataTransfer

落爺英雄遲暮 提交于 2020-02-29 07:17:07
问题 I have some drag and drop upload code that isn't working properly in IE 10. My event handlers look something like this: dragCatcher.on('drop', function (e) { e.preventDefault(); e.stopPropagation(); console.log(e.originalEvent.dataTransfer.files); }).on('dragenter', function (e) { e.preventDefault(); e.stopPropagation(); }).on('dragleave', function (e) { e.preventDefault(); e.stopPropagation(); }).on('dragover', function (e) { e.preventDefault(); e.stopPropagation(); console.log(e

IE 10 drag and drop upload gives empty dataTransfer

隐身守侯 提交于 2020-02-29 07:16:08
问题 I have some drag and drop upload code that isn't working properly in IE 10. My event handlers look something like this: dragCatcher.on('drop', function (e) { e.preventDefault(); e.stopPropagation(); console.log(e.originalEvent.dataTransfer.files); }).on('dragenter', function (e) { e.preventDefault(); e.stopPropagation(); }).on('dragleave', function (e) { e.preventDefault(); e.stopPropagation(); }).on('dragover', function (e) { e.preventDefault(); e.stopPropagation(); console.log(e

Removing event listeners before leaving a page

岁酱吖の 提交于 2020-02-25 09:37:54
问题 I've developed a javascript drag and drop that mostly uses the standard 'allowdrop', 'drag' and 'drop' events. I wanted to customise the 'ghosted' dragged object, so I've added a display:none div that get populated with the innerHTML of the draggable element and made visible (display:block;) when the user starts dragging. The draggable div is absolutely positioned and matches the mouse movements. For this I needed to add 3 event listeners to document.body. They are as follows: document.body

Cannot get file data from the clipboard using Flex

好久不见. 提交于 2020-02-25 04:30:26
问题 Given: A Flex TileList with the following event: <mx:nativeDragDrop> <![CDATA[ if(event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT)) { var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array; for each(var file:File in files) { // file.data is null here! } this.listData.refresh(); } ]]> </mx:nativeDragDrop> I am trying to create a list of thumbnails from jpegs that I drag into this TileList. Image.source can use the url to show the image, but I need to

D3 drag event behaviour: DragEvent.x and DragEvent.y values source

你。 提交于 2020-02-24 12:01:35
问题 I don't understand the behaviour of the D3 DragEvent object in Mike Bostock’s examples for D3. Those are the two examples I don't understand: Circle Dragging I Drag + Zoom This is the code that I don't understand: function dragged(d) { d3.select(this).attr("cx", d.x = d3.event.x).attr("cy", d.y = d3.event.y); } In this example, d.x and d.y are part of a data object that contains the last centre of the circle. What I expect to happen with this code, is that the attributes cx and cy of the

NSCollectionView - dragging shows a “hole” - want it to look lke the Finder

巧了我就是萌 提交于 2020-02-21 05:39:31
问题 I have an NSCollectionView. When I drag items (around the view, or outside of the view), I get the right appearance, but the cell is empty while the dragging occurs (see animated GIF below). The desired behavior is to be like the Finder - that is, the icon should remain in place and the dragged image appears in addition to it. I have tried a variety of things to no avail. For example, I tried setting the drag operation to Copy in sourceOperationMaskForDraggingContext. Can't remember the other

NSCollectionView - dragging shows a “hole” - want it to look lke the Finder

放肆的年华 提交于 2020-02-21 05:38:42
问题 I have an NSCollectionView. When I drag items (around the view, or outside of the view), I get the right appearance, but the cell is empty while the dragging occurs (see animated GIF below). The desired behavior is to be like the Finder - that is, the icon should remain in place and the dragged image appears in addition to it. I have tried a variety of things to no avail. For example, I tried setting the drag operation to Copy in sourceOperationMaskForDraggingContext. Can't remember the other

Drag and drop with 2 drop target

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-21 03:09:48
问题 I am looking for an example of drag and drop where the drag item has two distinct areas that have to match up with two droppable areas. Example: I would like the blue drag item to revert unless it is dropped in a position where each of its red children land on a green area. Ideally I would like to use jquery ui (as I have experience with it), but any javascript library would be fine, thanks in advance. 回答1: You can accomplish this by using a combination of draggable / droppable options. Given

PySide: Drag and drop files into QListWidget

一笑奈何 提交于 2020-02-20 10:39:51
问题 This is my first entry here so apologies for any newbie mistakes. I've searched both here and Google with no luck before posting. I want to be able to add images to a QListWidget, using drag and drop from a file browser. Dropping a valid file on the list widget also needs to trigger a function in the main class of my app, and pass it the image path. I found this code that does exactly that, but for PyQt4. Importing QtCore and QtGui from PySide instead of PyQt4 produces a segmentation fault