draggable

Drag and Drop in nested dataTables

五迷三道 提交于 2019-12-07 09:55:06
问题 I am using primeface 4.0. The primeface showcase only shows how to drag a draggable in to a droppable . But then how to drag a that draggable out of that droppable is never mentioned. I wantto make a dataTable that: Each td cantains a droppable panel which multiple draggable can be both draged in to and out of . A back bean object that "keeps data" of this dataTable, which I assume if the dataTable is 2*2, there will be 4 List in the back bean, each stores a list of draggable objects of

How to enable dragging in QGraphicsScene?

你离开我真会死。 提交于 2019-12-07 07:49:26
问题 I'm trying to put two pictures in the QGraphicsScene . One is fixed and the other one is movable. But I succeed only in putting those pictures in the QGraphicsScene , I can't move them. How can I achieve this? 回答1: You have to make sure the item is movable. Have a look at QGraphicsItem::setFlag. You'll have to do something like this : myImageItem->setFlag(QGraphicsItem::ItemIsMovable, true); 来源: https://stackoverflow.com/questions/3062465/how-to-enable-dragging-in-qgraphicsscene

Easiest way to make a list-like widget with drag and drop of items?

醉酒当歌 提交于 2019-12-07 07:15:00
问题 The simplest example I can think of are playlists, where you can drag a song to a different position in the list. I've done quite a few things with Swing but I've never seen an example with something like this. 回答1: Here's an example that might be close to what you want http://www.java2s.com/Code/Java/Swing-JFC/DragandDropJListandList.htm There is a demo in the Oracle page linked in the comment to the first question: http://download.oracle.com/javase/tutorial/uiswing/dnd/basicdemo.html Direct

Jquery Draggable with more than one handle

情到浓时终转凉″ 提交于 2019-12-07 05:42:25
问题 Is it possible to have a draggable element with more than one handle? I am initializing it twice, each time with a different handle param, but it doesn't work - only the first one works. 回答1: You should only pass the 'handle' param once, and it can either be a selector or an elements(/s). So, to make it work with more than one handle: $(elem).draggable({ handle: '#handle1, #handle2', }); More info / source: http://docs.jquery.com/UI/Draggables/draggable 回答2: Sure. Just have these handlers

QGraphicsItem move event - get absolute position

非 Y 不嫁゛ 提交于 2019-12-07 04:42:50
问题 I have a QGraphicsEllipseItem that I want to be movable and triggering signals on moving. So I subclassed QGraphicsEllipseItem and QObject and overrode the itemChange method to trigger a signal. That all seems to work but the positions that are reported seem to be relative to the old position of the item. Even if asking the item for its position seems only to retrieve the relative coordinates. Here is some code to make clear what I have done: class MyGraphicsEllipseItem: public QObject,

Drag and drop using basic jQuery framework

别等时光非礼了梦想. 提交于 2019-12-07 04:22:00
问题 Is it possible to achieve drag and drop using basic jQuery script (without using jQuery UI)? 回答1: In HTML5, there's an attribute called "draggable". <div draggable='true'>Drag me</div> <div id='dropzone'>Drop it here!</div> You could make use of the following events: var onDragEnter = function(event) { event.preventDefault(); $("#dropzone").addClass("dragover"); }, onDragOver = function(event) { event.preventDefault(); if(!$("#dropzone").hasClass("dragover")) $("#dropzone").addClass("dragover

jQuery UI Draggable jumps at the first drag

自闭症网瘾萝莉.ら 提交于 2019-12-06 17:55:28
Please refer to this jsFiddle example . At the first time dragging the draggable, it jumps out of viewable area. Yet it is still draggable. It just doesn't stick to mouse cursor. The following code is the main JS code I use. $('.sortable').sortable({ revert: true }); $('.draggable').draggable({ connectToSortable : '.sortable', revert : 'invalid' }); 来源: https://stackoverflow.com/questions/14524944/jquery-ui-draggable-jumps-at-the-first-drag

How can I disable text-selection in webkit browsers when using jQuery UI .draggable?

时光毁灭记忆、已成空白 提交于 2019-12-06 12:24:13
问题 I can't seem to disable text-selection in webkit browsers when using jQuery UI .draggable(). I've tried using the webkit specific css (-webkit-user-select and -webkit-user-drag) in various combinations but haven't had any luck. Here's a jsfiddle where you can reproduce the problem: http://jsfiddle.net/dmosher/8ZGLR/ 回答1: disableSelection is your friend here. .disableSelection() is an undocumented (for now) core utility. It's useful for making text elements, or elements that contain text, not

Jquery draggable issue

谁都会走 提交于 2019-12-06 10:09:04
问题 Basically what I want is that while dragging, if I go outside the containment area and release the mouse click there, the draggable element just sticks to the border from where I left the containement area. And when I move my cursor back in, the element sticks back to the cursor. It doesnt looks nice when you are just moving your cursor(not dragging) and the element is still getting dragged. Here is a fiddle to play with. Just drag and release the cursor outside the output area, you will get

Draggables Jquery UI, disable individual div on droppable

时光毁灭记忆、已成空白 提交于 2019-12-06 09:58:59
问题 I'm trying to make some educational site and one of the things I want to have the students do is drag items to an area before being able to proceed to the next stage. I was thing the way to do this was use the jquery droppables script and have the items draggable option disable when it is dropped in the droppable div. Then I was going to add 1 to a variable, when it gets to the right number the button to advance would be enabled. The problem is that I can't figure out how to make the