jquery-ui-sortable

Jquery sortable plugin for unordered list multi dimension

我们两清 提交于 2019-12-12 05:14:02
问题 This is my list multi dimensiosn : <div id="tree"> <ul> <li id="205">205 <ul> <li id="206">206 <ul> <li id="208">208</li> <li id="209">209</li> <li id="211">211 <ul><li id="212">212</li> <li id="213">213</li> </ul> </li> </ul> </li> <li id="207">207 <ul> <li id="210">210</li> </ul> </li> </ul> </li> </ul> </div> When using Jquery plugin sortable , i can only drag and drop elements which they are in the same 'ul' tag , for exemple , if i drag the "212" tag and i dropped it after "213" tag ,

How to Grab data from database using JQuery Sortable and post data back

こ雲淡風輕ζ 提交于 2019-12-12 04:29:36
问题 I am attempting to create a menu that allows the user to re order the list items into a new order. The list data is pulled from a database. I've coded the jQuery sortable functionality feature for my menu however, I am struggling to then save the data in the new order back to model after the user has re ordered the list. This is my code for the sortable, it all works except for the line with var objmodel . When this variable is created it manages to grab an empty object from the database and

Drag from sortable to droppable?

孤者浪人 提交于 2019-12-12 04:09:08
问题 Not sure if this can be done, some have said no, need to be able to drag from a sortable and drop on a dropable and have the drop actually occur. The jsfiddle is based on another example that implemented a trash can but I need the item to move to the new list. Note the drop only accepts items from sortable2. http://jsfiddle.net/LrVMw/4/ $("#sortable1, #sortable2").sortable({ connectWith: '.connectedSortable, #drop_zone' }).disableSelection(); $("#drop_zone").droppable({ accept: "#sortable2 li

Laravel 4 - change order of items

ぐ巨炮叔叔 提交于 2019-12-12 04:06:51
问题 I have two tables fichas and actividads related in a pivot table called actividad_ficha . In this pivot table I've created another column called orden_actividad (to short the 'activities' in every 'ficha'). I have a View where I show all the 'activities' related with one specific 'ficha'. I would like to be able to drag-and-drop my list of 'actividads' and save the new order automatically. I'm using some jQuery in my application, but AJAX resists to me. Do you know how can I get it? or maybe

Formatting Parameters for Ajax POST request to Rails Controller - for jQuery-UI sortable list

你。 提交于 2019-12-12 03:40:42
问题 I'm using the jQuery-UI Sortable Connected Lists. I'm saving the order of the connected lists to a Rails server. My approach is to grab the list ID, column ID and index position of each list item. I want to then wrap this into an object that can be passed as a parameter back to the Rails Controller to be saved into the database. So ideally i'm looking to format the parameter like this: Parameters: {"Activity"=>[{id:1,column:2,position:1},{id:2,column:2,position:2} ,...]} How do I properly

JQuery copy/append element, base object removed

寵の児 提交于 2019-12-12 03:15:17
问题 Trying to clone base element li.table-field-base to variable clonedItem , change some attributes and data on the new element and then append it to sortable list ul#tablefield-order-sortable . The result is that the element is appended, but the base element is removed, though i did copy it first. How could i keep the base element, so i can use it later again? Following is the piece of relevant code that does the copying/appending part: var clonedItem = $.extend({}, $('li.table-field-base')); $

Jquery UI .sortable() trigger select sort

我是研究僧i 提交于 2019-12-12 02:24:29
问题 I am completely stuck in trying to make an ul sortable and within the update function sort the (hidden) select with the new order of the items in the ul here is my function jQuery(document).ready(function ($) { function sort() { $('.element').sortable({ update: function (event, ui) { var draggingElement = $('.item'); draggingElement.each(function () { var ordering = $(this).index(); var option = 'opt' + ordering + ''; $("#list").find('#' + option + '').index(ordering); }); } }); }; sort(); })

Sinatra Ruby iterate over an array in a hash to send jQuery Sortable to database

白昼怎懂夜的黑 提交于 2019-12-12 01:32:35
问题 I've isolated my lack of knowledge down to this snipit I keep tweaking in irb. I'm trying to use jQuery's UI Sortable to send a post to the database, so far I can get it to send the update but it sends the entire array instead of each array item at a time. It's amazing that I have not found one post yet with someone trying Sinatra and Sortable. Hmmm Hash and sinatra code superslide = {"weee"=>["3", "4", "1", "2"]} moo = Sort.all moo.each do |o| o.sortorder = superslide['weee'] puts o

How to restore a jquery ui sortable list by using stored structure from db

泪湿孤枕 提交于 2019-12-12 01:27:34
问题 I've tried to store a list-structure in my db (based on this question [1]: How to serialize a nested sortable ul list) and after that I need a way to restore/reset the list if the page is refreshed or load new based on the data from db. Is there a build-in way to do this or how can I do that? In my list, I use nested elements to support the way to create flexible nested structure. This is what I already have The list <ul id="mysite" class="mysite editor-ul ui-sortable-handle ui-sortable"> <li

Connected Nested Lists in Jquery UI Sortable

柔情痞子 提交于 2019-12-12 01:08:23
问题 Ey dudes, please take a look at this fiddle: http://jsfiddle.net/HG8k6/. $(document).ready(function () { $("ul.containers").sortable({ axis: 'y', placeholder: "ui-state-highlight", forcePlaceholderSize: true }); $("ul.containers").disableSelection(); $("ul.rows").sortable({ axis: 'y', placeholder: "ui-state-highlight", forcePlaceholderSize: true }); $("ul.rows").disableSelection(); }); It's working ok in some way, I have containers and rows, I can move them perfect, but what I really want to