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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:39:35+00:00 2026-05-27T17:39:35+00:00

This code is working in Extjs 4.0.2a but when converted to 4.1 it no

  • 0

This code is working in Extjs 4.0.2a
but when converted to 4.1 it no longer works and gives an error

Uncaught TypeError: Cannot call method 'query' of undefined

Ext.onReady(function() {

    var panel = new Ext.Panel({
        renderTo: divtag,
        draggable: {
            insertProxy: false,
            onDrag: function(e) {
                var el = this.proxy.getEl();
                this.x = el.getLeft(true);
                this.y = el.getTop(true);
            },
            endDrag: function(e) {
                this.panel.setPosition(this.x, this.y);
            }
        },
        title: 'Panel',
        width: 200,
        height: 100,
        x: 20,
        y: 20
    });
});
  • 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-27T17:39:36+00:00Added an answer on May 27, 2026 at 5:39 pm

    Apparently there is a bug in this version of Ext. It wont work even if you try default D’n’D for panel like this:

    Ext.onReady(function() {
        var panel = new Ext.Panel({
            renderTo: 'divtag',
            draggable: true,
            title: 'Panel',
            width: 200,
            height:100,
            x: 20,
            y: 20
        }); //panel.show(); });
    });
    

    I menage to patch the code to work the way you want it, this code should work:

    Ext.onReady(function() {
        var panel = new Ext.Panel({
            renderTo: 'divtag',
            draggable: {
                insertProxy: false,
                onDrag: function(e) {
                    var el = this.proxy.getEl();
                    this.x = el.getX();
                    this.y = el.getY();
                },
                endDrag: function(e) {
                    panel.setPosition(this.x,this.y);
                },
                alignElWithMouse: function() {
                    panel.dd.superclass.superclass.alignElWithMouse.apply(panel.dd, arguments);
                    this.proxy.sync();
                }
            },
            title: 'Panel',
            width: 200,
            height:100,
            x: 20,
            y: 20
        }); //panel.show(); });
    });
    

    As a side note I should probably advice you not to do this anyway, because you can define your own DD for panel that you can use, and even better Ext already have one defined, so you can just override Ext panel to use default Ext.util.ComponentDragger, or in code, I advice you to do this:

    Ext.override(Ext.panel.Panel, {
        initDraggable: function() {
            var me = this,
                ddConfig;
    
            if (!me.header) {
                me.updateHeader(true);
            }
    
            if (me.header) {
                ddConfig = Ext.applyIf({
                    el: me.el,
                    delegate: '#' + me.header.id
                }, me.draggable);
    
                // Add extra configs if Window is specified to be constrained
                if (me.constrain || me.constrainHeader) {
                    ddConfig.constrain = me.constrain;
                    ddConfig.constrainDelegate = me.constrainHeader;
                    ddConfig.constrainTo = me.constrainTo || me.container;
                }
    
                me.dd = Ext.create('Ext.util.ComponentDragger', this, ddConfig);
                me.relayEvents(me.dd, ['dragstart', 'drag', 'dragend']);
            }
        }
    });
    var panel = Ext.create('Ext.panel.Panel', {
        id: 'test',
        renderTo: 'divtag',
        draggable: true,
        floating: true,
        title: 'Panel',
        width: 200,
        height:100,
        x: 20,
        y: 20
    });
    

    Code for a initDraggable function in panel override is taken from current stable version of Ext.window.Window.initDraggable method.

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

Sidebar

Related Questions

sorry but i'm still struggling to make this code working. It works if with
this code working in extjs 3 but now i convet my app to extjs
I have this code working in C#: var request = (HttpWebRequest)WebRequest.Create(https://x.com/service); request.Method = GET;
This is really strange but this code is working fine unless the value entered
runat=server /> But this code is not working How can I add multiple controls
i have tried this code to redirect a php page.but it s not working
I had this code working yesterday, but it seems like I edited it a
I have this code working fine a few times in my project but was
This doesn't indicate any error in my javascript code, but in the downloaded jquery.js
I am working through this extJS tutorial where you type in code into Firebug,

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.