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

  • Home
  • SEARCH
  • 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 1019521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:01:34+00:00 2026-05-16T11:01:34+00:00

I have a row where I can drag items into it, and sort them.

  • 0

I have a row where I can drag items into it, and sort them. This all works ok. I even have a delete event on each item, so it can be removed from the row.

I want an option where I can clone the row. I do this by using the clone function below:

clonedrow = $("#row1").clone(true);
clonedid = "row"+nextRowNumber; //nextRowNumber is a variable calculated by counting the rows that exist already.
clonedrow.attr("id",clonedid).insertAfter("#row1");

This all works, apart from the fact the draggable/sortable events in ‘row1’ are not copied to the cloned row. Am I doing something wrong? I thought by adding ‘true’ it copies the events…?

FWIW when loading the page, I have a function which automatically builds the first row, and applies the draggable/sortable/delete events to it…

  • 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-05-16T11:01:34+00:00Added an answer on May 16, 2026 at 11:01 am

    I don’t know too much about draggable, but there seems to be some strange behavior when cloning a draggable element with true. Perhaps you don’t want all the data cloned if some of it should be specific to that element.

    In this simple example, when you clone(true) one and try to drag the clone, the original is dragged.

    http://jsfiddle.net/ZmcHd/

    Perhaps it is better to just reapply the draggable().

    clonedrow = $("#row1").clone().draggable();
    

    http://jsfiddle.net/ZmcHd/1/

    If there are other settings that you need, then I’d store them in a variable in order to prevent duplication.

    var settings = {
            // some settings
    }
    
    clonedrow = $("#row1").clone().draggable(settings);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can we have alternate Row color to GtkMenu items? and how to increase menu
I have a data.frame with numeric values. How can I replace the each row
I have several billion rows of data in CSV files. Each row can have
I have jquery drag and drop working so I can move one row in
The javascript code I now have can toggle a single row of data. Whether
I have a row collection (DataRow[] rows). And I want to import all rows
I have an AdvancedDataGrid with XML dataProvider. Drag and drop in enabled, and works
Hi All I have a UITableView with the list of items fetched from sqllite.
I have a feeling that this question is very simple, but I just can't
I have a datagrid in WPF in which I can drag and drop stuff

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.