knockout-sortable | js binding to connect observableArrays | Frontend Framework library
kandi X-RAY | knockout-sortable Summary
kandi X-RAY | knockout-sortable Summary
knockout-sortable is a binding for Knockout.js designed to connect observableArrays with jQuery UI's sortable functionality. This allows a user to drag and drop items within a list or between lists and have the corresponding observableArrays updated appropriately. Note: The sortable binding assumes that the child "templates" have a single container element. You cannot use containerless bindings (comment-based) bindings at the top-level of your template, as the jQuery draggable/sortable functionality needs an element to operate on.
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 knockout-sortable
knockout-sortable Key Features
knockout-sortable Examples and Code Snippets
Community Discussions
Trending Discussions on knockout-sortable
QUESTION
My question is very similar to this one: disabling individual items in knockout-sortable
But the accepted answer keeps the item as a drop target. (The item itself isn't draggable, but you can drop items on top of it). I'm wondering if there's a good way to disable the item completely. jQuery recommends never enabling it in the first place like so: ( http://jqueryui.com/sortable/#items )
...ANSWER
Answered 2018-Mar-14 at 15:05Taking from the answer you mentioned, is this what you're trying to achieve?
QUESTION
I'm using RequireJS to load Knockout Sortable (v1.10), which has jquery-ui (v1.12) as a dependency. Both of these were added through bower and placed in my require config. However, I'm having some strange issues with require incorrectly fetching the path for some of the widgets.
My path looks like this for jquery-ui:
...ANSWER
Answered 2017-Dec-20 at 17:11After some more tinkering, I figured out I needed to slightly modify my path's as follows:
QUESTION
I am currently trying to develop a small function using knockout-sortable which should work as follows.
I have 3 observable collections: The first is an empty droppable area, the 2nd contains the 1st 3 items from a collection(visible) and the 3rd contains the remainder of my dataset(hidden). When dragging an item from the 2nd collection onto the 1st, the 1st item in the 3rd array that matches the "group" property of the item that has just moved needs to be inserted into the 2nd observable at the same index as the item that was just dragged out. It all seems to work, except when adding an item from the 3rd to second array at the 1st index it always ends up at the back of array. I have even added an if statement which will use unshift to combat this but it doesn't seem to work. Any help would be much appreciated. Here is a snippet of code where I attempt to insert the object into the correct index.
...ANSWER
Answered 2017-Nov-23 at 17:40To insert an item
at n
th index of an array, you need to call:
QUESTION
I'm reading Knockout Sortable documentation and I'm having trouble understanding what connectClass does in Sortable. I understand that if it's used for Draggble, it you can only drag items into that specified class. However, I'm not following what connectClass will do in Sortable?
...ANSWER
Answered 2017-Jul-19 at 14:48connectClass
can be used when you have multiple sortables on a page and only certain ones can drop onto other ones. Let's say that you have sortables A, B, C, and D. Your app may only allow A and B to drop with each other and C and D to drop with each other. You can use connectClass
to identify which sortables are connected.
Here is a quick example: http://jsfiddle.net/rniemeyer/brakyepb/
QUESTION
I'm using knockout-sortable and my goal is nestedSortable behaviour. I have a working light-weight fiddle example I've made, and everything is ok except one thing: I can't move children to element who doesnt have it initially.
Child elements prints there:
...ANSWER
Answered 2017-Apr-21 at 19:18You just need to give it some height. I took out the if
, put a class on the ul
QUESTION
I need to add text at the bottom of the document "The list was updated!" if the user updated the order of the sortable list.
Can you give me hints how to do it properly and in knockout-way?
...ANSWER
Answered 2017-Feb-02 at 00:19You can do this with a subscription to the observable array and a new observable to track the visible state of the notification.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install knockout-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