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 6831145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:42:10+00:00 2026-05-26T22:42:10+00:00

I am using the basic Drag and Drop example of Sencha and modifying it.

  • 0

I am using the basic Drag and Drop example of Sencha and modifying it. I need to have a button that is able to create a new div and make it draggable. I have been able to do the first thing, but then I can’t make it draggable.

I know if I do the following I make the div draggable:

new Ext.util.Draggable('my-div-id', {  });

but when I click the button for a second time, it does’t work anymore. It seems that I can only create one draggable div with the same id.

How can I solve this?

  • 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-26T22:42:11+00:00Added an answer on May 26, 2026 at 10:42 pm

    This is what I did:

    var count = 0;
    

    Inside my function to create a div:

    var divTag = document.createElement("div");
    divTag.id = "somename" + count;
    
    //Style the new div
    divTag.setAttribute("align","center");
    divTag.style.border = "1px solid rgba(0,0,0,.3)";
    divTag.style.width = "100px";
    divTag.style.height = "60px";
    divTag.style.background = "#5283D1";
    divTag.style.top = "170px";
    divTag.style.left =  "5px";
    divTag.style.position = "absolute";
    divTag.style.color = "rgba(0,0,0,.5)";
    divTag.style.borderRadius = "6px";
    
    divTag.className ="x-draggable";
    
    //added some text inside the div
    divTag.innerHTML = count + " new";
    
    document.body.appendChild(divTag);
    
    new Ext.util.Draggable('somename'+count, { 
    });
    
    count += 1;
    

    So with the variable count I create a new id for every div I generate, thus making them all draggable.

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

Sidebar

Related Questions

so I have built my own drag and drop shopping cart(very basic) using Jquery
I'm using Visual Basic 9 (VS2008) I want to create new Tabs as and
I have set up a site that is correctly using basic CRUD functionality succesfully.
I have a WCF service that will be using basic authentication and would like
Is it possible to achieve drag and drop using basic jQuery script (without using
I've been told that creating GUI's using drag and drop generates unnecesary code and
I'm using drag and drop on QWidget, I have reimplemented dragEnterEvent, dragLeaveEvent, dragMoveEvent and
I have a self-hosted WCF app using Basic HTTP Binding, no SSL, running in
I have a data mart mastered from our OLTP Oracle database using basic Materialized
I am using visual basic for coding. In my form I have a delete

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.