jquery-ui-sortable

JqueryUI sortable failed with scrolling

Deadly 提交于 2019-12-11 05:56:40
问题 I'm using jqueryUI sortable in my application so I have following problem: jsFiddle As you can see on this fiddle when you clicked on scrollbar sortable item is dragged and there are no way to drop it. What I want to do is prevent dragging element when it's scrolled. What I just do is searched events of sortable element, and try prevent scrolling but this doesn't work as I want. Any help would be appreciated. 回答1: You could create an inner-div with width and height 100% which you define as

Jquery Sortable - Replacing Items rather than swapping items

早过忘川 提交于 2019-12-11 05:10:51
问题 Is there any configurable option to achieve the feature like replacing the list items rather than swapping items in JQuery Sortable UI. Current feature is like Item1 Swaps with Item2 and vice versa. I need a feature like, If item2 is dragged and dropped on Item1, item2 should replace Item1 and Item2 position will be empty. Any help? thanks. 回答1: You can do it with the following code: $('#container').sortable({ connectWith: '#container', items: '.children', //#container > .children cursor:

jQueryUI sortable and draggable target won't scroll horizontally for drop but will for sort

被刻印的时光 ゝ 提交于 2019-12-11 04:17:02
问题 I have two divs that contain multiple divs and can scroll. I have a vertical div that has the draggable on the contained divs. My horizontal div is sortable and I connect the draggable to it via the connectToSortable. The horizontal sortable can scroll horizontally when rearranging items. However if I drag from the vertical to the horizontal it will not scroll the horizontal div like when I do a pure sort. I have already read all the entries here for scrolling a div with plugins like scrollTo

Alphabetically sort elements in sortable list with over 13 items

跟風遠走 提交于 2019-12-11 03:15:52
问题 I'm using jQuery UI to create several, interconnected sortable lists the html: <div class="ulContainer"> <div class="liHdr">Unassigned</div> <div class="ulWraper"> <ul class="connectedSortableUl un ui-sortable"> <li class="ui-state-default" style="">Frank Smith <input type="hidden" class="rowName" value="frank.smith"> <input type="hidden" class="rowEmail" value="frank.smith@email.com"> <input type="hidden" class="rowId" value="8VNe0ZT1v0"> <input type="hidden" class="rowTeam" value=""> <div

jquery ui sortable propagation dynamically created sortables

天涯浪子 提交于 2019-12-11 02:42:34
问题 I want to have a feature that every time I drag an image from sortable on empty space a new sortable is created. If I store two images in a sortable, than I can drag them and new sortables are really created(gray boxes). Now I would desire to be able to drag an image out of the newly created gray box, so that again a new gray box would be created if I would drop on an empty space. This does not work. How can I propagate my function for uls to dynamically created uls? refresh does not seem to

jQuery sortable connectWith multiple lists

霸气de小男生 提交于 2019-12-10 17:33:20
问题 I have two lists with 8 list elements within each one. I would like to drag either element into either list, and get the total order of both lists together. Currently the order is classed as two separate sortable lists: [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7] However I would like it to be (obviously in the order of the elements): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] The parameter connectWith doesn't seem to be working at all, and I cannot drag elements into other

Jquery Sortable - Disable onclick=“” while sorting

久未见 提交于 2019-12-10 15:54:37
问题 is it possible to disable onclick="" while sorting? I Have a working example here http://www.jsfiddle.net/V9Euk/59/ Peter 回答1: If you don't want to do it with a flag variable as per @nigative , you can do the following with the start and stop methods: $("#lop").sortable({ revert: '100', placeholder: 'auo', start: function(event, ui) { ui.item[0].oldclick = ui.item[0].onclick; ui.item[0].onclick = null; }, stop: function(event, ui) { ui.item[0].onclick = ui.item[0].oldclick; } }); 回答2: you can

jsquery sortable with inline-block display display scratches

▼魔方 西西 提交于 2019-12-10 15:35:24
问题 I'm trying to play with connected sortable list with JQuery, however, if I use display:inline-block in my li CSS, the placeholder and the placement is not correct. It's usually higher, and also the items are resized so that cause wordwrap. If I change display:inline-block by float:left here ul.fieldlist li { display:inline-block; list-style-type: none; } Then the dragdrop is working fine, but for some reasons i'm not able to drag back to the original sortable. I have made a jsfiddle to show

Drop() gets called twice with Sortable/Droppable

会有一股神秘感。 提交于 2019-12-10 14:55:52
问题 I have this code right here. I have two problems though: In the receive function, how can we get the element that just got dropped into the sortable? Not the one that was used to drop a new one, but the actual one that got dropped into the list? Since I couldn't find that, I decided to use the drop() function, but now, why is that function getting called twice?! I don't want that! $( "#sortable" ).droppable({ activeClass: "ui-state-default", hoverClass: "ui-state-hover", drop: function( event

Uncaught TypeError Object has no method 'sortable'

旧城冷巷雨未停 提交于 2019-12-10 14:19:26
问题 I've found a few fixes for this issue already but they aren't specific to this. I've read simple things like Sortable() needs to be lowercase. Of course, I do not have it set as uppercase first. I already had this working and then suddenly it decided to spit out the following in the console Uncaught TypeError: Object [object Object] has no method 'sortable' on line:210 which correspondes to: // Line 210 is below $('.sortable').sortable({ stop: get_post_order }).disableSelection(); // Check