Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9156893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:52:48+00:00 2026-06-17T12:52:48+00:00

Using the example here as a starting point, I set out to customize my

  • 0

Using the example here as a starting point, I set out to customize my draggable and sortable data. In the linked example, we have simple text in the draggable. I replaced it with a select tag.

When dragging the select element into the sortable, I would like to use only the value of the selected option when moving it to the sortable list. To this end, I use the custom helper, but unfortunately, as soon as I drop it, it turns into a select element again.

$("#draggable").draggable({
   connectToSortable: "#sortable",
   opacity: 0.8,
   cursor: "move",
   helper: function () {
       return $("<div>" + $(this).text() + "</div>");
   },
   distance: 20
});

How can I fix this? Thanks for looking. JSFiddle is here:

PS: Removing all the classes from droppable didn’t help either, and affects when sorting within the group as well, so this is the wrong approach

$("#sortable").droppable({
   drop: function (event, ui) {
       alert('dropped');
       $(ui.draggable).removeClass();
   },
   activeClass: "ui-state-hover",
   hoverClass: "ui-state-active"
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:52:49+00:00Added an answer on June 17, 2026 at 12:52 pm

    Bit of a convoluted solution, but here goes:

    First I modified the custom helper function in the draggable. I find the class I’m looking for, and clone only the first instance (li), but add to it the text of all the list boxes. This is due to the design of fcbkcomplete. Anyway, now we are left with a single list item and the text I need. I add the ui-state-default class to the clone, and I’m done here

                    $("#draggable").draggable({
                    distance: 10,
                    cursor: "move",
                    helper: function (e, ui) {
                        var newListItem = $(this).find('.bit-box').first().clone().removeClass().addClass("ui-state-default");
                        var fullCommand = "";
                        $(this).find('.bit-box').each(function( index ) {
                            fullCommand += $(this).text() + " ";
                        });
    
                        newListItem.text(fullCommand);
                        return (newListItem);
                    },
                    revert : true
                    });
    

    In the droppable, I still ended up handling the drop event, but this time, using ui.helper.clone instead of ui.draggable.

                    $("#container").droppable({
                    accept: '.product',
                    drop: function (event, ui) {
                        var x = ui.helper.clone();
                        x.removeClass().attr('style', '');
                        x.addClass("ui-state-default");
                        x.appendTo('#container');
                        ui.helper.remove();
                    }
                });
    

    There are still some errors I need to fix wrt css, but this works exactly as expected now 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning and trying simple example using node.js and mongoskin. here is my
I'm using the sample app from microsoft here: http://msdn.microsoft.com/en-us/library/hh394041(v=vs.92).aspx as a starting point to
I'm using the example found here: http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_01 The issue is that when I specify
Example: here is the string: blablabla123:550:404:487blablabla500:488:474:401blablablabla here is what I'm using: string reg =
I found an example here to create a select list with optgroups using KnockoutJS.
I follow example from here using section listview http://lalit3686.blogspot.com/2012/05/sectionadapter.html But how can I implement
I'm using the SSLStream example from msdn here . The client code seems to
I'm so close! I'm using the XNA Game State Management example found here and
Here is an (artificial) example of using a function that returns an anonymous struct
I am developing a application using PHP. Some example code is here. $url =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.