If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Not from USA
    Member #
    2783 times
    Is it possible to have multiple handles for a sortable element within jQuery?

    I've come up with a sortable list of items using jQuery and it does do everything I want, except that you can't drag/sort the list using the image itself. I know I can create a handle for the image to let it sort that way, but when I do that, the rest of the row isn't draggable/sortable either.

    So what I'd like is for the list to be sortable using both the image and all the rest of the row, but I can't quite get a handle on how to do it.

    Here's the code for the sortable div:
    $(document).ready(function () {
        rowDraggable = $("#sortable-container");
        var rows = rowDraggable.find(".row-container-draggable")
            axis: "y",
            containment: "document",
            delay: 100,
            distance: 30,
            scroll : true,
            tolerance:  "pointer",
            forcePlaceHolderSize : true,
            update: function (event, ui) {
                var count = 1;
                var spans = rowDraggable;
                rowDraggable.find("span").each(function (index) {
                    var clsName = $(this).attr("class");
                    if (clsName == "counter") {
                        count += 1;
                count = 1;
                rowDraggable.find(".count").each(function (index) {
                    var photoId = 0;
                    $(this).find("input").each (function (index) {
                        var fieldId = $(this).attr("id");
                        if (fieldId.indexOf ("Photo_Order") > -1) {
                        } else {
                            photoId = $(this).val();
                        var ajaxurl = siteRoot + "ajax-xml/update-photo-order/?PUI=" + photoId + "&order=" + count;
                    count = count + 1;
        rows.mouseover(function () { $(this).addClass("row-highlighted"); });
        rows.mouseout(function () { $(this).removeClass("row-highlighted"); });
    (Yes, I know it's messy right now, but I do intend to clean it up).

    I'd upload a page for this, but I can't in this case. It's under development and login/password based.
    Attached Images Attached Images
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 09:24 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: