jquery-ui-sortable

Jquery - sort DIV's by innerHTML of children

半世苍凉 提交于 2019-12-17 10:16:56
问题 I've got html that looks something like this: <div id="sortThis"> <div id="1">Price:<span class="price">20</span><span class="style">blue</span></div> <div id="2">Price:<span class="price">23</span><span class="style">red</span></div> <div id="3">Price:<span class="price">10</span><span class="style">red</span></div> <div id="4">Price:<span class="price">29</span><span class="style">green</span></div> <div id="5">Price:<span class="price">35</span><span class="style">blue</span></div> </div>

jQuery UI Sortable table and cell is shrinking while dragging tr

半城伤御伤魂 提交于 2019-12-14 03:52:28
问题 While dragging am facing two issues. table it self is shrinking when i have a hidden td . dragged tr cell( td )s are shrinking This is the code of the sortable: $('tbody').sortable({ items: ">tr", appendTo: "parent", opacity: 1, containment: "document", placeholder: "placeholder-style", cursor: "move", delay: 150, }); jsfiddle link 回答1: The problem with the shrinking of the table is because you have a hidden cell (and in the placeholder that the sortable creates for you there are 5 cells and

jQuery sortable - move item between 2 connected lists keeping count

旧时模样 提交于 2019-12-14 01:21:32
问题 I have two list with 6 items, connectedWith a class of .connectedSortable When I move an item between the two lists, it gets appended to the target list, and removed from the source list. So now we have a list with 5 items, and a list with 7 items. How can the items remain 6 items per list, and we just move the top most in the target list to the first list (automatically rearranges itself in the same order as if it were one list)? <ul class="connectedSortable"> <li class="ui-state-default"

jQueryUI sortable,draggable revert event

柔情痞子 提交于 2019-12-14 01:16:14
问题 I have a problem with jQuqeryUI. I would like to run some code whenever an element is dragged and dropped on an invalid target. As far as I can see, there is no predefined event for this, but I have thought about combining information from following events: over, out, remove and stop, to achieve this. However that might sound like it's going to be a mess, is there a cleaner way yo do it? 回答1: You can pass a method to the revert option as well, for example if we take the example demo like this

Why can't I get jquery ui sortable to have a “smooth” horizontal auto scroll?

ぐ巨炮叔叔 提交于 2019-12-13 23:35:04
问题 I have a web page that uses jquery UI sortable with connectwith to have a list of lists (think similar to trello). One issue is that i can't seem to get a smooth horizontal auto scroll when the number of columns exceeds the window width. So when the horizontal scroll get enacted when I drag an item to the right I have to also drag a bit up or down to get the scroll bar to move to the right (instead of just doing it by dragging directly right without this extra fiddling). Here is a jsfiddle

ondrop event - create new element

冷暖自知 提交于 2019-12-13 20:10:50
问题 Im using sortable feature of jquery. please check the image, If i drag an item from Base Data and drop it in Filters, i need a text box to be created on Texfields column. i dont want to pre populate all the Filters and Textfields. so if i can drag and drop a item from base data that i require to Filters. A text box should be create for each drop.. help please!!! my code HTML <div class="col-md-3"> <h4>Base Data</h4> <ol class="simple_with_no_drop vertical"> <li>Item 1</li> <li>Item 1</li> <li

jQuery Sortable lock item

▼魔方 西西 提交于 2019-12-13 17:26:06
问题 Is it possible to lock an item in a Sortable list once it's been dropped? Basically, I have a sortable list [OBJECT] that the user is supposed to place the objects into steps. The steps are static/not moveable. Like this: [Step 1] [OBJECT 1] [Step 2] [OBJECT 2] [Step 3] [OBJECT 3] [Step 4] [OBJECT 4] So lets say I drag object 1 to step 3: [Step 1] [OBJECT 2] [Step 2] [OBJECT 3] [Step 3] [OBJECT 1] [Step 4] [OBJECT 4] Now any object that's dragged SHOULD NOT change the position of [OBJECT 1]

jQuery $(ui.draggable).remove() not working with IE

好久不见. 提交于 2019-12-13 15:24:12
问题 I can get IE to remove objects as long as it is not the current draggable object. This is working on Chrome and Firefox. Is there something I'm doing wrong? <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="http://code.jquery.com/ui/jquery-ui-git.js"></script> </head> <body> <ul id="list"> <li id="test-1" class="dropme">One</li> <li id="test-2" class="dropme">Two</li> </ul> <div id="bucket" style="border:1px solid black"> <p>Drop items here and they

Selecting multiple items with jQuery Sortable()?

南笙酒味 提交于 2019-12-13 13:17:26
问题 I need to drag multiple items simultaneously within a jquery sortable container. In this case, it's a series of nested divs within a parent div which has the sortable() behavior applied. Any suggestions? 回答1: If you are asking if you can select multiple items (say 1, 3, and 7 in one instance, and 3,4, and 8 in another), I do not believe jquery has a way to do this currently, since the event is tagged to onclick. On the other hand, if you want to keep certain items grouped (1 and 2 are always

Implementing a sortable Image collection not working in Meteor

北城余情 提交于 2019-12-13 09:07:37
问题 Implementing a sortable Image collection doesn't work <template name="gallery"> <div id="grid-container" class="cbp-l-grid-agency grid"> {{#each images getCurrentCategory}} {{> image}} {{/each}} </div> </template> Template.gallery.created = function(){ Tracker.autorun(function () { Meteor.subscribe('images'), self.limit.get() }); } Template.gallery.rendered = function(){ //// Image reordering ///// this.$('#Images').sortable({ stop: function(e, ui) { el = ui.item.get(0) before = ui.item.prev(