drag-and-drop

How do I remove a file from the FileList

半腔热情 提交于 2019-12-16 22:19:10
问题 I'm building a drag-and-drop-to-upload web application using HTML5, and I'm dropping the files onto a div and of course fetching the dataTransfer object, which gives me the FileList. Now I want to remove some of the files, but I don't know how, or if it's even possible. Preferably I'd like to just delete them from the FileList; I've got no use for them. But if that's not possible, should I instead write in checks in code that interacts with the FileList? That seems cumbersome. 回答1: If you

How to make two lists interchangeable, and when selection complete save dropped

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 04:01:11
问题 I am using jQuery and specifying two selectors together. Then I try to refer each variable in this code: UL_HeadersToOmit - is the list to choose from UL_dropedCols - is the list to be passed as reference to next function or " stage " $('#next').click( function () { var dropblUL = $('#UL_dropedCols li'); alert(dropblUL.length); }); $('#UL_dropedCols, #UL_HeadersToOmit') .sortable({ connectWith: '#UL_HeadersToOmit, #UL_dropedCols' }) .droppable({ drop: function (event, ui) { var curUL = $(this

Dojo DnD: how to access newly copied node on onDndDrop event?

夙愿已清 提交于 2019-12-14 03:44:15
问题 I am working on code like the following. 01: var c1 = new dojo.dnd.Source('container1', {copyOnly:true}); // container1 is a div 02: var c2 = new dojo.dnd.Source('container2'); // container2 is a div 03: var list = []; 04: for (var i = 0; i < 3; i++) { list.push( dojo.create('div') ); } 05: c1.insertNodes(false, list); 06: 07: function checkDndCopy(nodes, target){ 08: dojo.forEach(nodes, function(node){ alert(node.id); } ); 09: } 10: dojo.subscribe("/dnd/drop", function(){ 11: var mgr = dojo

Why is my form going to background on DragDrop?

拥有回忆 提交于 2019-12-14 03:19:30
问题 At the end of a drag&drop operation, I'm showing a form using ShowDialog . Problem: When the form is closed, my main form is pushed behind any other application windows. Code: private void ctrl_DragDrop(object sender, DragEventArgs e) { // ... if (e.Effect == DragDropEffects.Move) { string name = e.Data.GetData(DataFormats.Text).ToString(); viewHelperForm.ShowDialog(view.TopLevelControl); // ... } Question: What can I do that the main form stays on top? 回答1: Your ShowDialog() call is blocking

Change the size of dragged clone when hovering droppable?

自闭症网瘾萝莉.ら 提交于 2019-12-14 02:41:18
问题 $(".drag").draggable({ helper: 'clone', appendTo: "body" }); $( ".drop" ).droppable({ over: function(event, ui) { $(ui.draggable).css({width:'30px',height:'30px'}); }, drop: function( event, ui ) { if($(ui.draggable).parent() !==$(this)){ $(ui.draggable).appendTo($( this )); $(ui.draggable).tooltip({ disabled: true }); $(ui.draggable).css({float:'left'}); } }}); I am trying to change the size of the dragged clone item when i hover over the droppable area but leave the original the same size

Adobe Air: drag & drop grouped components

孤人 提交于 2019-12-14 02:28:37
问题 I am trying to create Adobe Air application in which I require the components below: Allow me to elaborate this mockup: There are 2 panels on each side, and the items inside these panels can be drag and drop on each other, just like moving items around in 2 folders. Several tutorials have shown that a list with dragEnabled = "true" dropEnabled = "true" dragMoveEnabled = "true" will do the job. However, here comes the crucial part. I want my item in the list to have such a structure that I

Add footer to Android TouchListView

╄→尐↘猪︶ㄣ 提交于 2019-12-14 02:17:24
问题 Hi I'm using the TouchListView control from here: https://github.com/commonsguy/cwac-touchlist and I've added some buttons to add to the list in the footer: mFooter = getLayoutInflater().inflate(R.layout.edit_homepage_footer_layout, null); mListView = (TouchListView) findViewById(R.id.sectionList); mListView.addFooterView(mFooter); It all seems to be working fine until I drag an item in the list, at which point the footer collapses (to the height of one list item I think) obscuring the

How to implement mouse joint in Sprite Kit?

岁酱吖の 提交于 2019-12-14 01:43:38
问题 I have working implementation of drag and drop feature written in Cocos2d + Box2d for iOS. I need to port it to Sprite Kit. The logic is pretty basic: when user touching the screen, find sprite under the finger create mouse joint between found sprite and the scene's physics body, set joint's target to position of touch when touches moved, update joint's target to new position when touches ended, remove the joint Everything is working quite well. I like the way physics is simulated when

How do you make an element undragable in Raphael?

柔情痞子 提交于 2019-12-14 01:33:52
问题 I made an element dragable using element.drag(start, move, up); When I want to make the element undragable, I can somewhat achieve this using the method from the documentation : element.undrag(f); // Any undefined variable works as the argument This makes it so that the element cannot be moved anymore. This method has 2 problems: This makes all elements on the page undragable. start() still fires once for each element. I have an opacity change triggered in start() so it's quite obvious. How

wxPython: Dragging a file into window to get file path

喜欢而已 提交于 2019-12-14 01:10:38
问题 I want to drag a file into a window and get the file path. I've tried doing this: class CSVDropper(wx.FileDropTarget): def __init__(self, data): wx.FileDropTarget.__init__(self) self.data = data def OnDropFiles(self, x, y, filenames): self.data = filenames print self.data then in the main window: # Drag & Drop self.csv_path = None self.drop_table = CSVDropper(self.csv_path) self.SetDropTarget(self.drop_table) But this does nothing. I've tried running this tutorial code, but it doesn't do