jquery-ui-sortable

jQuery UI Sortable: How do I prevent a specific list item from being moved?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 02:26:16
问题 I have this list: <ul> <li class="line"><a href="#" class="drag">header (do not sort)</a></li> <li class="line"><a href="#" class="drag">line one</a></li> <li class="line"><a href="#" class="drag">line two</a></li> </ul> How can I prevent the first li from being moved? 回答1: You can specify which items within the Sortable are actually sortable. This should do the trick—change the HTML as follows: <ul> <li class="line" id="header"><a href="#" class="drag">header (do not sort)</a></li> <li class

jQuery UI Sortable: How do I prevent a specific list item from being moved?

大兔子大兔子 提交于 2019-12-21 02:26:08
问题 I have this list: <ul> <li class="line"><a href="#" class="drag">header (do not sort)</a></li> <li class="line"><a href="#" class="drag">line one</a></li> <li class="line"><a href="#" class="drag">line two</a></li> </ul> How can I prevent the first li from being moved? 回答1: You can specify which items within the Sortable are actually sortable. This should do the trick—change the HTML as follows: <ul> <li class="line" id="header"><a href="#" class="drag">header (do not sort)</a></li> <li class

jQuery: draggable connect to sortable. draggable item has a different DOM from sortable list

谁说胖子不能爱 提交于 2019-12-20 12:40:56
问题 I am now able to drag an item to a sortable. But the sortable list has a different DOM. <!-- The draggable items. Has the "original" DOM in the LI tags. --> <ul class="draggable_text"> <li><span>DRAG THIS A</span></li> <li><span>DRAG THIS B</span></li> </ul> <!-- This list has a different DOM in the LI tags --> <ul id="stagerows"> <li><p>This is a new DOM dragged from "DRAG THIS A"</p></li> <li><p>This is a new DOM dragged from "DRAG THIS B"</p></li> </ul> $(document).ready(function() { $('

jQuery Sortable without jQuery UI

自古美人都是妖i 提交于 2019-12-20 09:53:32
问题 I am in need of "Sortable Drag & Drop" functionality and I'm using jQuery. I can't really use jQuery UI, because for this project it would be an overhead (I'd need to add many KB of JS and CSS only to use small part of functionality). Is there any plugin that you could recommend or maybe a simple implementation path, that I can follow? The solution must be as lightweight as possible, preferably based on jQuery/Sizzle or pure JavaScript. 回答1: You can build your own JQuery download on jqueryui

How do I connect multiple sortable lists to each other in jQuery UI?

為{幸葍}努か 提交于 2019-12-20 09:43:15
问题 I'm new to jQuery, and I'm totally struggling with using jQuery UI's sortable . I'm trying to put together a page to facilitate grouping and ordering of items. My page has a list of groups, and each group contains a list of items. I want to allow users to be able to do the following: Reorder the groups Reorder the items within the groups Move the items between the groups The first two requirements are no problem. I'm able to sort them just fine. The problem comes in with the third requirement

Jquery ui - sortable: drag by icon 'handle' within sortable element

房东的猫 提交于 2019-12-20 09:08:35
问题 I have jquery ui sortables working fine but my sortable elements have other interactive elements within them. In order to prevent accidental sorting when interacting with the elements within the sortable divs, I'd like to somehow make the dragging movement for the sortables only occur when dragging a certain element within the sortable, such as a 'move' icon that might reside in the top left corner of each sortable. Is this possible with generic jqui, or would I need to write my own hook? 回答1

JQuery Draggable + Sortable: How to tell if item was actually added to my sortable list?

狂风中的少年 提交于 2019-12-20 05:36:06
问题 OK, I'm probably missing something obvious here, but my searches aren't turning up anything helpful. I've set up a sortable list and connected a draggable "palette list" to it, as explained here: http://jqueryui.com/demos/draggable/#sortable I can drag items from my draggable list and drop them on my sortable list. That works fine. I need to fire a function only when one of these items is dropped onto the sortable. I've tried the "stop" hook on the draggable item, but that fires regardless of

Offset issues with jQuery Draggable into an iFrame based Sortable

梦想与她 提交于 2019-12-20 03:55:10
问题 I'm having quite a bit of trouble resolving problems with offsets related to draggable elements being dropped into a sortable area within an iFrame. The following leaned-down example to demonstrates the problem here. Make sure to keep your window fairly narrow, as otherwise it's very difficult to drop the elements into the iFrame at all. It should be pretty obvious that you cannot drag the item and drop it in the designated place, instead you must drag about 350 pixels to the right of the

How to make jQuery UI sortable with nested dropdown menu work?

风流意气都作罢 提交于 2019-12-20 02:57:16
问题 I've read everything similar to my problem posted here but not found any solution. I have created a menu with sub menu entries inside dropdowns. All menu entries are sortable to all menu levels. root menu entries to child lists and the other way. Nearly everything works fine but sorting to the first dropdown results a bug. It is neighter not possible to sort a menu entry before the first dropdown nor to sort inside the first dropdown. By trying to sort inside the first dropdown the

Jquery UI draggable not scrolling the sortable container

自古美人都是妖i 提交于 2019-12-19 09:18:37
问题 I have some draggable items(#draggable li) which i am dragging and dropping them in a sortable(#sortable). The sortable is wrapped by two divs and the outermost div has overflow-y: scroll. The mechanism of drag and drop works fine until the sortable list expands and scrolls. When I try to drag and directly drop an Item on the sortable, i cannot get the sortable scrollbar to auto-scroll in the way I want to go(say want to go up to drop above the first element or go down to drop below the last