drag-and-drop

cdkDropList with ng-template on dynamic component list do'snt work

不打扰是莪最后的温柔 提交于 2020-04-30 16:02:18
问题 I'm trying to use Drag&Drop features released with Angular Material 7. And dynamically creating component using ng-tempalte. <div cdkDropList (cdkDropListDropped)="dropLocal($event)"> <ng-template #components></ng-template> </div> and added cdkDrag at components. I am using createComponent at parent component to keep on create components. viewContainerRef.createComponent but dragdrop functionality is not functional since cdkDrag must be in a tag nested inside the one with cdkDropList,

PyQt: Is it possible to drag/drop QWidgets in a QGridLayout to rearrange them?

旧时模样 提交于 2020-04-16 05:47:13
问题 I am looking for a way to create a grid of graphs that can be dragged/dropped to rearrange the order. My first try was using QDockWidgets as they allow for drag/drop, however they were limited in a lot of other ways. Would it be possible to implement this function in a QGridLayout? For now I have a QGridLayout with 3x3 matplotlib widgets. Here is an example of the desired layout outcome. Sample code: import sys from PyQt5 import QtWidgets from matplotlib.figure import Figure from matplotlib

Unable to use DragControls

我与影子孤独终老i 提交于 2020-04-16 02:32:11
问题 I am a beginner with three.js and I was trying to implement a feature where one must be able to drag a 3d model. I came across DragControl in this process and I am not able to use it in my code. when I use new DragControls(objects, camera, renderer.domElement) I get this error capture.js:9 Uncaught ReferenceError: DragControls is not defined at capture.js:9 and when i use the new THREE.DragControls(objects, camera, renderer.domElement) I get This error Uncaught TypeError: THREE.DragControls

How to programmatically trigger drag events with d3.js?

懵懂的女人 提交于 2020-04-11 09:53:26
问题 I wrote some code that uses a drag event for svg elements. The code works fine and I would like to write some tests for it. Instead of manually moving my mouse by hand I would like to programmatically trigger the dragstart and drag events with selection.dispatch: svgSelection.dispatch('dragstart',{bubbles:true}); svgSelection.dispatch('drag',{bubbles:true}); However, the events do not seem to be fired. Maybe I use the wrong event keys or need to include some additional option? I also tried to

dragexit vs dragleave - which should be used?

ぃ、小莉子 提交于 2020-04-06 04:38:49
问题 The HTML Drag and Drop API defines two very similar events, dragleave and dragexit , which along with dragenter are intended to help track the current drop target. A quick search didn't turn up any current and clear documentation of the two events, when one should be used over another, and the browser support, so I thought I'd ask here. I'll share the resources I found so far: The HTML specification has detailed description of when each event is supposed to be fired, but it requires some

dragexit vs dragleave - which should be used?

橙三吉。 提交于 2020-04-06 04:34:07
问题 The HTML Drag and Drop API defines two very similar events, dragleave and dragexit , which along with dragenter are intended to help track the current drop target. A quick search didn't turn up any current and clear documentation of the two events, when one should be used over another, and the browser support, so I thought I'd ask here. I'll share the resources I found so far: The HTML specification has detailed description of when each event is supposed to be fired, but it requires some

Angular drag and drop not working when dropping elements in n-ary tree represented using recursive template

a 夏天 提交于 2020-03-25 20:06:02
问题 I'm new to angular material drag and drop. My app is using an n-ary tree, and since I don't know its form apriori, I've been forced to use a recursive template in order to represent it. The last couple of days I've been trying to use Angular material drag and drop to reorder siblings. If I remove the root node everything works just fine, but I cannot remove the root node since I need it to traverse the tree for other operations. Bellow is a simplified form of the tree. In reality, the tree

Angular drag and drop not working when dropping elements in n-ary tree represented using recursive template

我与影子孤独终老i 提交于 2020-03-25 20:05:34
问题 I'm new to angular material drag and drop. My app is using an n-ary tree, and since I don't know its form apriori, I've been forced to use a recursive template in order to represent it. The last couple of days I've been trying to use Angular material drag and drop to reorder siblings. If I remove the root node everything works just fine, but I cannot remove the root node since I need it to traverse the tree for other operations. Bellow is a simplified form of the tree. In reality, the tree

Angular material drag and drop - merge elements

半城伤御伤魂 提交于 2020-03-25 18:20:59
问题 I'm building and app where there are multiple items rendered in set of columns. (For sake of demonstration let's say 4 columns) I'm trying to achieve functionality of dragging and dropping items onto each other which will result in merge of those two items. typescricpt data structure Details{ id:number; columns:Column[]; } Column{ id:number; item:Item[]; } Item{ id:number; text:string; } So I have details component with : <div fxLayout="row wrap" fxLayoutAlign="center" fxLayoutGap="5px"

Angular material sorting near drag & drop

与世无争的帅哥 提交于 2020-03-25 12:33:24
问题 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