rubaxa-sortable

List items not dragging using Sortable.js

让人想犯罪 __ 提交于 2019-12-25 08:06:27
问题 Sortable.Js newbie here, so please be gentle. I'm trying to implement a sortable list in my page using Sortable.js. I'm not getting any errors upon execution, however when I tried to drag my list items, they're not moving at all. Here's my HTML: <ul id="forcedranking" class="wizard-contents-container-ul forcedRankCls" ng-show="isForcedRankingQuestion"> <div class="answers-container"> <div class="answer-child-container"> <li ng-repeat="query in currentQuestionObject.choices | orderBy:[

Rubaxa Sortable how to get array of items

我的梦境 提交于 2019-12-22 07:13:01
问题 I know this is going to be obvious, but I can't figure it out. Im using Rubaxa/sortable and would like to update my DB with ajax when an item is added, removed or list is sorted. var editableList = Sortable.create(document.getElementById('editable'), { animation: 150, filter: '.js-remove', onFilter: function (evt) { evt.item.parentNode.removeChild(evt.item); }, onSort: function(evt) { console.log(editableList.toArray()); // not working } }); document.getElementById('addUser').onclick =

Rubaxa Sortable how to get array of items

大兔子大兔子 提交于 2019-12-22 07:12:32
问题 I know this is going to be obvious, but I can't figure it out. Im using Rubaxa/sortable and would like to update my DB with ajax when an item is added, removed or list is sorted. var editableList = Sortable.create(document.getElementById('editable'), { animation: 150, filter: '.js-remove', onFilter: function (evt) { evt.item.parentNode.removeChild(evt.item); }, onSort: function(evt) { console.log(editableList.toArray()); // not working } }); document.getElementById('addUser').onclick =

Vue.Draggable delete item by dragging into designated region

◇◆丶佛笑我妖孽 提交于 2019-12-13 17:01:31
问题 I've been banging my head against the wall trying to figure this out. I found an example of pretty much exactly what I'm trying to do via the Sortable.js library repo here but I haven't been able to implement it using Vue.Draggable. My theory of how to do it is add a <draggable/> element that is in the same group as the rest of the elements and listen for an @add event on it, then remove that dragged element from its list. One gotcha (maybe) is I'm trying to designate a "trash" button as the

Restrict container/parent for Sortable

我是研究僧i 提交于 2019-12-10 10:05:58
问题 OK, so here I am again, playing with @RubaXa's Sortable plugin (and hopefully he is somewhere around here, as this one is simply rather complicated...) A few discoveries (it took me some time to fully understand the mechanism, but I think I'm quite right) Case 1 if we set one div with same-type contents, it's instantly sortable. E.g.: HTML <div id="myContainer"> <h3>Item 1</h3> <h3>Item 2</h3> </div> JavaScript new Sortable(document.getElementById("myContainer")); Demo: http://jsfiddle.net