jquery-sortable | A flexible , opinionated sorting plugin for jQuery | Frontend Framework library
kandi X-RAY | jquery-sortable Summary
kandi X-RAY | jquery-sortable Summary
A flexible, opinionated sorting plugin for jQuery
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jquery-sortable
jquery-sortable Key Features
jquery-sortable Examples and Code Snippets
Community Discussions
Trending Discussions on jquery-sortable
QUESTION
The problem is related to test this sortable list plugin. I need to move the cursor to element A then make a click and hold (drag) this element and move to another element B. Then wait one second and then release dragged element A. The second element B should open a new placeholder for dragged element A.
The problem is that element B should know that the cursor is above it and should open the placeholder. But it does not react. Element B listens for the mouse move event, but I am not sure if moveToElement()
triggers this event at all. I have a code that works fine but does not open the placeholder.
ANSWER
Answered 2021-Mar-16 at 20:51As I write this question I tried to simulate mousemove event by little steps over the element B and it works. So the code now looks like:
QUESTION
I've already submitted an issue here but just wanted to check if you can solve this faster here.
Trying to exclude an item from being draggable works but not from being sortable -- the problem is that other elements can be placed behind it.
SortableJS Docs don't seem to have exclude.
Here's the expected behavior using jQuery UI:
...ANSWER
Answered 2021-Mar-13 at 05:42If you check documentation there is one option filter: ".ignore-elements" you can use this to ignore elements which you do not want to be draggable . Then , check if the related target element doesn't have exclude class depending on this return true or false to cancel event.
Demo Code :
QUESTION
I have imported the sortable and jquery references to my html, however, it says that
Uncaught TypeError: $(...).sortable is not a function
and
Uncaught Error: jQuery is required for jquery-sortablejs
I have never used jquery before hence new to this all. I have taken this exact code as a demo of this website, and it is working on code pen, however wont work on my own laptop.
...ANSWER
Answered 2020-Nov-19 at 09:29The issue with your code is due to the order of the script references. Any script which relies on jquery.js has to be included in the page after jQuery. In addition you're including two versions of jQuery which can cause issues. I'd suggest keeping 3.5.1 and removing 1.12.4. Try this:
QUESTION
I'm trying use jquery-ui sortable connected lists and persist sorting changes in a Rails app.
- Lists have many tasks.
- Lists can be sorted among each other - works.
- Tasks can be sorted among each other - works.
- Tasks can moved between lists - does not work correctly:
ANSWER
Answered 2020-Oct-29 at 04:00Try this
QUESTION
I am using sortablejs to make a drag+drop list. I want two buttons, one that outputs the current order of list elements, and another that just resets the current order back to its original state.
I found a couple resources about how to print the current order and to how reset it, but since I'm still somewhat new to javascript, I've been having trouble implementing them.
Currently, my alert just outputs [object HTMLUListElement]
and I can't figure out the reset.
Code below. Any help would be appreciated!
...ANSWER
Answered 2020-Aug-24 at 22:29Your issue is in this line:
QUESTION
We're using the jQuery Sortable library for dynamic menu management similar to WordPress. And it has multi level management.
...ANSWER
Answered 2019-Nov-25 at 22:12I fiddled around with this and was able to make it work. Check my forked fiddle here: jsfiddle.net/qf7n89oe.
The only change I made was to replace
QUESTION
I'm working with jquery-sortable
and I'm having some difficulty modifying the list container (ul
) when it's been emptied or loaded empty. For example, If you have two containers:
- A collection list to drag from that always contains a few items.
- A destination list which loads empty (unless it is being edited and it will contain some list items but can be emptied by dragging them out of there
The empty container (ul
) should display a message (i.e. nothing here) whenever it loads empty or it gets emptied on edit.
I tried several approaches with no avail.
SAMPLE HTML FOR EMPTY CONTAINER
...ANSWER
Answered 2019-Mar-28 at 15:38You need to handle on every list change the error message state so let's say we have the following HTML - example from your demo:
QUESTION
I am trying to use this JavaScript library called SortableJS along with jQuery & jQuery SortableJS. I have the front-end functionality working, but my issue is trying to get it to work successfully with an AJAX request.
I added console.log('test')
to see if I could get any results from the AJAX request, but nothing showed. This also makes me believe that my issue has something to do with AJAX.
JavaScript
...ANSWER
Answered 2019-Jul-31 at 00:15After some more digging I found the solution, instead of using jQuery functions I had to use SortableJS's built-in toArray()
function to get the updated list of "#sortable-cards". The toArray()
function uses data-id
instead of id
for your div, li, etc. Here's a little more information regarding this here.
JavaScript
QUESTION
I have a Gulp script to concatenate, and minimize javascript. It seems to be working but doesn't output the combined file.
The script is (complete - including extra debug bits):
...ANSWER
Answered 2019-Jun-04 at 14:39I never worked out what was wrong, but went direct to the doc's and started again (previous version was from a example)..
Works with the below (much simpler) script.
QUESTION
I'm trying to use the jquery-sortable, basically for nesting and ordering items. At the first level and the first item child, it works well for the nesting and sorting. However the childs of the second and subsequent items cant be sorted probably.
...ANSWER
Answered 2018-Jan-22 at 20:12After playing with your fiddle, I noticed it is working without bootstrap: .list-group-item
has as a style position:relative
, and it seems as parents of nested container can not contains position: relative
: it probably mess with the position calculation, the lib seems miss calculating container's position which have "position:relative". It is probably an issue with the lib itself. To solve it, you can:
Solve the lib
Add a hack to bootstrap:
Html:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jquery-sortable
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page