jquery-ui-sortable

jQuery UI: sortable and draggable + sortable and droppable

喜欢而已 提交于 2020-01-05 08:02:46
问题 I have two lists. They are sortable but not connected (elements of list "one" cannot be mixed with elements of list "two") I want elements of list "one" be droppable and elements of list "two" be draggable, because I want to drag and drop element of list "two" into list "one". How should I do? EDIT: I tried to make the question as general as possible but maybe I should be more clear... sorry. Elements of list one are "categories" and they should be sortable. Elements of list two are "links"

jQuery UI: sortable and draggable + sortable and droppable

僤鯓⒐⒋嵵緔 提交于 2020-01-05 08:02:34
问题 I have two lists. They are sortable but not connected (elements of list "one" cannot be mixed with elements of list "two") I want elements of list "one" be droppable and elements of list "two" be draggable, because I want to drag and drop element of list "two" into list "one". How should I do? EDIT: I tried to make the question as general as possible but maybe I should be more clear... sorry. Elements of list one are "categories" and they should be sortable. Elements of list two are "links"

jQuery UI Sortable/Draggable causing window jump

梦想与她 提交于 2020-01-04 15:28:24
问题 On my web page I have a div containing a sortable UL, and whenever I scroll to the bottom of my page and drag the last LI my page jumps and the scrollbar (on the entire window) grows. Here is a JSFiddle that almost captures my issue: www.jsfiddle.net/u5afykpf. To see something close to what is happening to me, scroll to the bottom and drag the last element downwards. You will see the scrollbar grow and shift. On my page however where there is a lot more content and height this causes a shift

jQuery UI sortable - do something when user starts dragging an element from a specific block

拟墨画扇 提交于 2020-01-04 09:25:14
问题 This question is related to this I have two block one is "draggable" and the other is "sortable". What I want to do is when I start dragging an item from "sortable" to do something via jQuery. this is my JS: $(".sortableList").sortable({ start: function(event, ui) { alert("Do something here!"); } }); $(".draggable").draggable({ connectToSortable: '.sortableList', cursor: 'pointer', helper: 'clone', revert: 'invalid', start: function (event, ui) { $(this).addClass('testing'); } }); $("#sidebar

jQuery UI sortable, each sortable div contains an iFrame gets refreshed in FF3 but not in IE7

拟墨画扇 提交于 2020-01-04 03:54:19
问题 I'm using the jQuery UI Sortable on DIV which contains DIV tags. Inside of each of the sortable DIV's is an iFrame with a src= to a different site. In IE7, sorting works as expected. If you've navigated within the iFrame, the iFrame retains the current state. However, in FF3, when sorting stops and the iFrame is reloaded with the original url specified. This is not what I want. I've tried using both DIV/DIVs and UL/LIs and both behave the same. 回答1: This is a bug in FF (and apparently Safari

jQuery UI: How can I cancel the revert of a sortable element on successful drop on a droppable element?

匆匆过客 提交于 2020-01-04 01:51:18
问题 I have a sortable list in which are several elements that need to be able to be reordered by the user. Alternatively the elements can also be dragged onto 5 available dropzones ( droppable containers). The problem I am encountering is this: When the drop is successfully done on a droppable zone, the revert animation of the sortable is still playing animating the dropped element back into the sortable list. Instead I would like to animate it in a way that the helper is taken from where the

Optimal way to save order of jQueryUI sortable list with Meteor

为君一笑 提交于 2020-01-03 17:28:49
问题 I need some guidance/suggestions for an optimal way to save the order of a sortable list that takes advantage of Meteor. The following is a scaled down version of what I'm trying to do. The application is a simple todo list. The end goal for the user is to sort their list where the data is picked up from the database. As the user sorts tasks, I would like to save the order of the tasks. I've implemented this application without Meteor using php/ajax calls using sortable's update event that

How to make a single <td> element in a <tr> not sortable (jquery ui)

萝らか妹 提交于 2020-01-03 17:23:27
问题 I have a table like this <table> <tr class="sortable"> <td>Days</td> <td>Monday</td> <td>Tuesday</td> <td>Wednesday</td> <td>Thursday</td> <td>Friday</td> <td>Saturday</td> </tr> <tr class="sortable"> <td>Works</td> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> </tr> </table> In this, I don't want the <td> 's "Days" and "Works" not sort-able but remaining in the row. 回答1: Make the row headers <th> as they should be and include only <td> elements. <table> <tr class=

jQuery ui sortable - save to database with Python/Flask/SQLite

人盡茶涼 提交于 2020-01-03 06:33:43
问题 i need a drag and drop effect, just finding the jQuery sortable the most viable and easy solution, but I would like to save the positions after reordered. Using php/sqlite i can do this but as I am using the framework flask the solution would have to be in python. I came to this code searching here html: $(function() { var $sortables = $("#sortMe").sortable({ stop: function() { var sortedItems = $sortables.sortable("toArray"); } }); }); py: app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://

wordpress - Sortable custom fields columns

99封情书 提交于 2020-01-03 05:14:10
问题 I added some custom fields (dates) in my admin columns. I try to make them sortable but in order to do that I need to convert them from string to date. My naive and simple code obviously doesn't work... Can someone point out my error(s) ? add_action( 'pre_get_posts', 'orderby_date' ); function orderby_date( $query ) { $orderby = $query->get( 'orderby'); if( 'start' == $orderby ) { $query->set('meta_key','class_start'); $query->set('orderby',"STR_TO_DATE(meta_value,'%m/%d/%Y')"); } } 回答1: This