Search Results

Search found 340 results on 14 pages for 'sortable'.

Page 2/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jQuery sortable drop within itself.

    - by Janis Peisenieks
    So my question here is: Can I place a sortable element within another sortable element of the same level. Example: <ul class="sortable"> <li class="subsortable">Some text</li> <li class="subsortable">Some text</li> </ul> into: <ul class="sortable"> <li class="subsortable">Some text<li class="subsortable">Some text</li></li> </ul> I've been trying to do this for a day now, and I can't seem to find a way to do this.

    Read the article

  • jquery sortable item cached? #sortable items: '.class1' filter is not working when class is changed

    - by liz
    hello everyone, i came across a weird problem today: i created a sortable list of divs. each div has a class="class1" and items is set to 'class1' (see below simplified code). each div has an a href link that calls a function toggleLock. this function replaces class="class1" with class="locked" for that div. for example: will become the problem is: even though #sortable is set to "make" only items with class="class1" sortable, replacing the class still allows to be sortable. seems like item class is cached at some point. i've tried to refresh #sortable ($('#sortable').sortable("refreshPosition") and $('#sortable').sortable("");), but that didn't work. i've tried both ways of replacing the class: attr('class','lock') and removeClass(), then addClass(). still is sortable. if class is not changed dynamically, but loads into DOM as , then it's not sortable as expected. why wouldn't replacement of the class from class1 to locked prevent that div from being sortable? am i missing something? sample code: <div id="sortable"> <div class="class1" id="1"> <div class="sortHandle">....</div> <href="javascript:void(null);" onclick="toggleLock($(this).attr('id').replace('R',''));" id="R1">lock</a> <p>This is item 1</p> </div> <div class="class1" id="2"> <div class="sortHandle"></div> <href="javascript:void(null);" onclick="toggleLock($(this).attr('id').replace('R',''));" id="R2">lock</a> <p>This is item 2</p> </div> <div class="class1" id="3"> <div class="sortHandle"></div> <href="javascript:void(null);" onclick="toggleLock($(this).attr('id').replace('R',''));" id="R3">lock</a> <p>This is item 3</p> </div> </div> js: $(function() { $("#sortable").sortable({ items: '.class1', handle: '.sortHandle', cursor: 'move', start: function(e,ui) { el = e.target; startPos = ui.item.prevAll().length+1; }, update: function(event, ui) { data = $('.class1').sortable('toArray'); newPos = ui.item.prevAll().length+1; alert("position: "+startPos+"; newposition: "+newPos); } }).disableSelection(); });

    Read the article

  • jQuery Sortable - Limit number of items in list.

    - by Adam
    I have a schedule table I'm using jQuiry Sortable for editing. Each day is a UL, and each event is an LI. My jQuery is: $("#colSun, #colMon, #colTue, #colWed, #colThu").sortable({ connectWith: '.timePieces', items: 'li:not(.lith)' }).disableSelection(); To make all LI's sortable except those with class "lith" (day names). User can drag an event from day to day, or add new events by clicking a button, which appends a new dragable event (LI) to the fist UL (Sunday). I want to make each day accept only up to 10 events. How do I do this? Thanks in advance!

    Read the article

  • How to callback the new list id jQuery UI: sortable

    - by PARyGuy
    Hi, I'm trying to use the sortable widget for my site. I have a mini scheduling app that I'd like to display a list of appointments for the week sorted by days. For this example we'll use only two days ( 2 lists ). If I wanted to drag an appointment (list item) from day 2 over to day 1, is there a way I can callback the id of list 1 after I dragged an item to it? I can find the id of the parent list upon page load but I can't seem to be able to pull the new id after sort. Is this even possible? <script type="text/javascript"> $(function() { $("#day1, #day2").sortable({ connectWith: '.sortable' }).disableSelection(); }); </script>

    Read the article

  • JQuery - Ajax saving sortables in connected lists when sortable item is moved

    - by Ben Sinclair
    I have multiple JQuery sortable lists that connect with each other... They allow you to assign users to certain roles. Basically what I want to do is when a user is dragged from one list to another, I want JQuery to pick up the first list that the user was moved from so that I can send an AJAX request to delete it from that list in my database. I tried the following but every time you move the user over a list and haven't even dropped it within a list, it sends this request which means I'll be sending multiple AJAX requests... Does that make sense? $( ".selector" ).sortable({ out: function(event, ui) { ... } }); From my testing, I can use the following code to just update the list that user has been moved to so I've got the second half covered: $( ".selector" ).sortable({ receive: function(event, ui) { ... } }); Hopefully I am making sense :)

    Read the article

  • Example of tree.drop_mode with jQuery sortable anywhere

    - by fred
    Hello Everyone, I have a working tree of galleries next to a sortable list of image thumbnails. I've been vainly trying to set up the galleries tree so that users can add images to the galleries by dropping the sortable thumbnails on to the galleries tree. I've been told this requires drop_mode. All efforts to get it to work have failed and I can't really make heads or tails of the drop_mode documentation. I've sought out some working examples via Google of just such an application but have failed. Can anyone point me to a working example of either a draggable or sortable list that successfully drops on to a tree and passes along some parameters between the two? Thanks!

    Read the article

  • jquery.ui sortable using a table and item:tr , placeholder difficulties

    - by greg
    Hi I would really like to give some sortable goodness to the myriad old tables I have created. A little work has a proof of concept behaving ok. My one sticking point is that the placeholder does not work at all in IE 7 when using item:TR . It works OK in FF. I can make an perform correctly. It seems to be specific to tables and Any ideas, I have been running through forums, not seeing a lot of people using sortable with tables. <style type="text/css"> .dndPlaceHolder { background-color:Red ; color:Red; height: 20px; line-height:30px; border: solid 2px black; } .dndItem { background-color: #c0c0c0; border:solid 1px black; padding:5px; } </style> <script type="text/javascript" > $(function() { $("#myTable").sortable( { placeholder:'dndPlaceHolder', distance:15, items:'tr', forcePlaceholderSize:true, change : dndChange, update : dndUpdate } ); $("#myTable").disableSelection(); $("#myList").sortable( { placeholder:'dndPlaceHolder', distance:15, items:'li', forcePlaceholderSize:true, change : dndChange, update : dndUpdate } ); $("#myList").disableSelection(); }); function dndChange(event,ui){ } function dndUpdate(event,ui){ var msg = ''; } </script> <table id='myTable' > <tr class='dndItem' id='1'> <td>0 Active - Active</td> </tr> <tr class='dndItem' id='2'> <td>1 Closed - Closed</td> </tr> <tr class='dndItem' id='3'> <td>2 OnHold - On Hold</td> </tr> <tr class='dndItem' id='4'> <td>3 Pending - Pending</td> </tr> </table> <BR> <UL id='myList' > <li class='dndItem' id='1'>0 Active - Active</li> <li class='dndItem' id='2'>1 Closed - Closed</li> <li class='dndItem' id='3'>2 OnHold - On Hold</li> <li class='dndItem' id='4'>3 Pending - Pending</li> </ul>

    Read the article

  • get the start position of an item using the jquery ui sortable plugin

    - by Rippo
    I am using the jQuery UI sortable plugin and I am trying to get 2 alerts I want the staring position of the element and the finished position of the element. $(function() { $("#filterlist ul").sortable({ opacity: 0.6, cursor: 'move', update: function(event, ui) { alert(ui.item.prevAll().length + 1); } }); }); I can get the position of the item after it has been dragged by using:- ui.item.prevAll().length + 1 What do I use to get the position it started from?

    Read the article

  • Make jQuery sortable items droppable to their peers

    - by user316727
    I have a sortable list (of tasks). It helps prioritize tasks, so I want to keep this functionality. Now I want to add subtasks to the functionality: I want to enable users to drag one task over to another task and drop it there to turn it into a subtask. Applying .draggable() and .droppable() to items that are already sortable has no effect. What could I do?

    Read the article

  • JQuery UI Sortable

    - by RussP
    Can someone please help me with this one: When using UISortables where - and how do I put "serialize" into the JQuery function? I have 4 columns class '.columm' and each wit a unique id - col1,col2,col3 & col4. I can get the drag & drop bit to work I now need to put the "final" positions into a serialized array. Here is my code: $(".column").sortable({ revert: true, scroll: true, appendTo: 'body', connectWith: '.column', delay:200, stop: function() { $(".column").each(function(){ var test = $(this).attr('id'); alert(test); // //var myArray = $(this).sortable("serialize"); }) }, revertDuration:50000, scope:'scope', opacity: 0.80, }); You will see alert test. I have done this to see if I can get the col id's into an alert and I can, but where do i put .sortable( "serialize" , [options] ) and how do I do that for the 4 columns to create 1 single serialized array? having done that how/where do you set the order when you next load the page? (OK yes, I do intent to "store" the serialized array) Help please - thanks

    Read the article

  • sortable list using jquery ui not passing updated list order

    - by Matthew Berman
    I am following the sortable lists railscast and got everything working except when I sort, the same (original) order gets passed to the update method each time, so it doesn't update the true order. Here's the code: In the view: %tbody#lineup{"data-update-url" => sort_lineups_url} - @lineup.pieces.each_with_index do |piece, index| = content_tag_for :tr, piece do = render 'piece', :piece => piece, :index => index and pieces.js.coffee: jQuery -> $('#lineup').sortable( axis: 'y' update: -> $.post($(this).data('update-url'), $(this).sortable('serialize')) ); sort and show methods of lineupscontroller: def show @lineup = Lineup.find_by_user_id(current_user.id) @pieces = @lineup.pieces.order("position") end def sort params[:piece].each_with_index do |id, index| current_user.lineup.pieces.update_all({position: index+1}, {id: id}) end render nothing: true end and the update request: Started POST "/lineups/sort" for 127.0.0.1 at 2012-06-24 20:06:14 -0700 Processing by LineupsController#sort as */* Parameters: {"piece"=>["8", "2", "1", "4", "3", "7"]} User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 2 LIMIT 1 Lineup Load (0.6ms) SELECT `lineups`.* FROM `lineups` WHERE `lineups`.`user_id` = 2 LIMIT 1 SQL (2.9ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 1 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 8 SQL (0.6ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 2 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 2 SQL (0.6ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 3 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 1 SQL (0.5ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 4 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 4 SQL (0.6ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 5 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 3 SQL (0.5ms) UPDATE `pieces` INNER JOIN `piece_lineups` ON `pieces`.`id` = `piece_lineups`.`piece_id` SET `position` = 6 WHERE `piece_lineups`.`lineup_id` = 3 AND `pieces`.`id` = 7 Rendered text template (0.0ms) so each time i drag+drop the list, it sends the same order again. what am I doing wrong that the params isn't passing the right, updated order? Completed 200 OK in 2757ms (Views: 1.0ms | ActiveRecord: 6.7ms)

    Read the article

  • jQuery UI Sortable - serialize multiple columns

    - by oshirowanen
    Dear stackoverflow experts, I have a little script which allows me to use jQuery to sort div tags nicely between 3 columns. The jQuery can be seen below: $(".column").sortable( { connectWith: '.column' }, { update: function(event, ui) { alert($(this).sortable('serialize')) } }); If I move an item from column 1 to column 2, it will display 2 alerts, showing the serialized data for the 2 affected columns. The problem is, I need to know the column ids too, so I can eventually save the data into a database. Right now, if it is possible to just display the column id in an alert but, that will be enough for me to continue. Any help will be greatly appreciated. Thanks

    Read the article

  • JQuery UI sortable: restore position based on some condition

    - by dafi
    I call sortable.stop() to make an ajax call to store some data after drag&drop operation. When the ajax call returns an error (application logic error or net problem) I want to move the dragged element to its original/start position, how can I achieve it? The scenario should be user drags A to B the sortable.stop() event is called, it triggers an ajax call the ajax call returns an error inside the stop() event we get the ajax error move A to its original position user again move A to B everything is ok A remains in its new position in B Steps 6-8 are shown to clarify a successive drag can be done and previous error must be forgotten

    Read the article

  • jquery ui sortable serialize from children

    - by FFish
    I want to send an Array with image paths and captions to a PHP script after I sorted the images. I can do 'serialize' or 'toArray' on the lists, but how to get the attributes from the img tag? <ul class="gallery"> <li id="li-1"> <img src="tn/001.jpg" alt="first caption" /> </li> <li mycaption="some caption" id="li-2"> <img src="tn/002.jpg" alt="second caption with éèçà international chars" /> </li> </ul> $(".gallery").sortable({ update : function() { serial = $('.gallery').sortable('serialize'); alert(serial); /* $.ajax({ url: "sort.php", type: "post", data: serial, error: function() {alert("theres an error with AJAX");} }); */ } });

    Read the article

  • Knockout.js nested sortable bindings

    - by user2391998
    I am working with the knockout.js sortable plugin; however, I ran into a problem that I have so far been unable to solve. I have two sortable bindings, one for buckets and another for bucketItems. I am able to reorder bucketItems between buckets and between buckets; however, I am unable to reorder buckets. Would you have any idea why this would be? I am also using nested with bindings, but as far as I can tell, this is not what is causing problems. I would greatly appreciate any insight you have to offer. Thank you so much for your time!

    Read the article

  • jQuery UI sortable issue

    - by colourandcode
    When I try to use a sortable event . (For instance the stop() event) It only works when I bind it using : $('.selector').bind('sortstop', function(event, ui) { ... }); rather than $('.selector').sortable({ stop: function(event, ui) { ... } }); Is there a missing piece in this? The only reason I ask is because when I bind using the actual bind() method it's not giving me access to the event or ui parameters I pass in. I'm always returned undefined.

    Read the article

  • jQuery UI sortable on select options

    - by user1038814
    I'm trying to get jQuery UI default sortable to work on options in a select multi list box but can't seem to get it working. Can this work with a select option? I've only seen examples with <li> everywhere. Here's my JavaScript: $(function() { $( "#secondSelectms2side__dx" ).sortable(); $( "#secondSelectms2side__dx" ).disableSelection(); }); And the HTML: <select title="" name="secondSelectms2side__dx" id="secondSelectms2side__dx" size="8" multiple="multiple"> <option value="4">asdsdsds</option> <option value="10">bsdsdsdsd</option> <option value="2">csdsdsds</option> </select>? My code is on jsFiddle: http://jsfiddle.net/noscirre/DRUPe/

    Read the article

  • z-index not working in IE8 with the sortable jQuery plugin

    - by Ojtwist
    I'm working with the jQuery Sortable plugin to drag and drop images from one box to another box. This works fine in ff,chrome and safari but it fails in IE8. It seems that when you start dragging that the image is send to the back. I've tried to solve this by adding the z-index option to the sortable plugin, i've tried appending it to a node higher in the hierarchy (body). It appears that setting a z-index on every other item in the page would fix this, haven't tried it yet and i'm not planning on doing this because this would mess up alot. So the user can drag an image from 1 gallery to the next gallery screenshot of how it should work: http://img69.imageshack.us/i/draganddrop.jpg/ Some html: <!--SECOND ARROCRDION ITEM --> <a class="flickr_accordeon_header" id="flickr_second_header" href="javascript:;">__MSG__SEARCH_FOR_PHOTOS__</a> <div> <p class ="flickr_text" > __MSG__SEARCH_FOR_PHOTOS__</p> <form method="GET" action="javascript:;"> <p> <input type="text" value="__MSG__SEARCH__" id="flickr_key_input" class="flickr_changeColorNormal" /> <button class="s3d-button flickr_search" id="flickr_seach_button"> <span class="s3d-button-inner" >__MSG__SEARCH__</span> </button> <img src="/devwidgets/flickr/images/ajax-loader-gray.gif" alt="__MSG__LOADING_IMAGE__" id="flickr_loading_img" /> <a href="javascript:;" id="flickr_refresh_key_button"><img src="/dev/_images/recent_activity_icon.png" alt="refresh" title='refresh' /></a> </p> </form> <div id="flickr_input_error">__MSG__INPUT_ERROR__</div> <div id="flickr_input_same_error">__MSG__INPUT_SAME_ERROR__</div> **<div id="flickr_key_gallery" ><ul class="flickr_key_ul"><li></li></ul></div>** <div id="flickr_key_pagging" ></div> </div> </div> <!--SLIDING SIDEBAR --> <div id="flickr_sidebar" class="jcarousel-skin-tango"> <div id="flickr_side_paging"></div> **<ul> <li><img src="/devwidgets/flickr/images/drop-image.png" alt="__MSG__DROP_HERE__" class="flick_drop_here"></li> </ul>** </div> The images get rendered into the ul, so basically it's just an ul with li's with images javascript for sortable: horizontal: { helper: "clone", // Instead of dragging the real image a copy will be dragged connectWith: ["#flickr_sidebar ul"], // To be able to drag and drop an image to another image gallery they need to be connected cursor: 'pointer', //change the cursor when dragging opacity: 0.50, //Change the opacity while dragging appendTo: 'body', //When dropped the images need to be appended to the image gallery where they are dropped containment: 'body', //Make sure the user can't drag the images outside the widget revert: true, // if the user releases the image ouside the dropbox it'll return to it's original position zIndex: 9999 } I've tried it with setting the dragged image to absolute and the container on relative... doesn't work Anyone know how to solve this in IE8 ?

    Read the article

  • jquery sortable scroll problem

    - by Sam Vloeberghs
    Hi I'm having problems using the sortable function of jQ:uery UI. The scroll doesn't seem to work.. If the second list ( lists are created on the table rows in a tbody and each tbody is connect ) isn't visible I want it to be possible to scroll towards it for dropping my table row. This is my HTML set up: <ul> <li> <ul> <li> <table class="treeleerling"> <tbody class="oder0"> <tr class="suborder0"> </tr> <tr class="sub1order"> </tr> </tbody> </table> </li> </ul> </li> <li> <ul> <li> <table class="treeleerling"> <tbody class="oder1"> <tr class="suborder0"> </tr> <tr class="suborder1"> </tr> </tbody> </table> </li> </ul> </li> </ul> And jQuery code $(document).ready(function() { $("#left tbody").sortable({ connectWith : '#left tbody', scroll : true, scrollSensitivity: 40, }); }); The sorting works fine, but the scrolling doesnt.. I'm doing something wrong or what? Plz help and advice.. Thx in advance!

    Read the article

  • jquery-sortable using behavior of a linkedlist

    - by BabaBooey
    I suspect I'm not looking at this issue in the right way so here goes. I have essentially a LinkedList of data on a web page (http://en.wikipedia.org/wiki/Linked_list) that I'd like to manipulate using traditional Linked List behavior (i.e. just updating the reference/id of the "next" object) for performance reasons. Where this gets a bit tricky is I'd ideally like to use Jquery's sortable to do this. Like the user would drag something up/down and I could just do an Ajax call to the server with the id of the object that moved and the new parent id of that object (and then behind the scenes I could figure out how to reconnect things..maybe need more data than that...). But every example I've seen where sortable is used they were sending the whole re-indexed list to the database to update which seems unnecessary to me. With a linked list to change an element's "index" I only need to make 3 updates which depending on the size of the list could be a big performance savings. Anyone have an example of what I'm trying to do...am I too far in left field?

    Read the article

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

    - by Hung Luu
    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 format my parameters to be passed in this Ajax POST request? Right now, with the approach below, I'm passing on Parameters: {"undefined"=>""} This is my current jQuery code (Coffeescript) which doesn't work: jQuery -> $('[id*="day"]').sortable( connectWith: ".day" placeholder: "ui-state-highlight" update: (event, ui) -> neworder = new Array() $('[id*="day"] > li').each -> column = $(this).attr("id") index = ui.item.index() + 1 id = $("#" + column + " li:nth-child(" + index + ") ").attr('id') passObject={} passObject.id = id passObject.column = column passObject.index = index neworder.push(passObject) alert neworder $.ajax url: "sort" type: "POST" data: neworder ).disableSelection() My apologies because this seems like a really amateur question but I'm just getting started with programming jQuery and Javascript.

    Read the article

  • Nested Sortable JQuery list doesn't work in IE while it does in FF

    - by Ben Fransen
    Hello everybody, While I'm using this site quite often as a resource for jQuery related problems I can't seem to find an answer this time. So here is my first post. During daytime at work I'm developing an informationsystem for generating MS Word documents. One of the modules I'm developing is for defining a default chapterselection for the table of contents and selecting texts by the given chapters. A user can submit new chapters and if necessary, add them as childchapter to a parent, flag them as 'adopt in TOC' and link a default text (from another module) to the chapter. My chapterlist is retreived recursively from a MySQL table and could look something like this: <ul class="sortableChapterlist"> <li>1</li> <li>2 <ul class="sortableChapterlist"> <li>2.1</li> <li>2.2</li> <li>2.3 <ul class="sortableChapterlist"> <li>2.3.1</li> <li>2.3.2</li> </ul> </li> </ul> </li> </ul> In FireFox the code works like a charm but IE (7) doesn't seem to like it that much. I'm only able to correctly drag arround the mainchapters. When attempting to drag a subchapter, no matter it's level, the correspondending mainchapter lifts up with some child, never all. This is the jQuery code I'm using to accomplish the task: $(function(){ $(".sortableChapterlist").sortable({ opacity: 0.7, helper: 'clone', cursor: 'move' }); $(".sortableChapterlist").selectable(); $(".sortableChapterlist").disableSelection(); }); Does anybody have some ideas about this? I'm guessing IE kinda falls over the multiple class reference "chapter_list" in combination with jQuery trying to handle the draggable/sortable. Kinds regards from Holland, Ben Fransen

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >