Results 1 to 4 of 4

Thread: panel drag and drop is not working in extjs 4.1

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    2
    Vote Rating
    0
      0  

    Default panel drag and drop is not working in extjs 4.1

    This code is working in Extjs 4.0.2a but when converted to 4.1 it no longer works and gives an error like:
    Uncaught TypeError: Cannot call method 'query' of undefined

    My Code is:

    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
    });
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    getLeft(true) is only returning zero. If you are wanting to use XY coords, then you can use getXY() but what are you trying to accomplish?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,615
    Vote Rating
    55
      0  

    Default

    You are overriding implemented functions in Ext.panel.DD

    You should only need draggable: true

    Having said that, there's a slight bug with synching the panel position with the position of the dragged proxy upon mouseup if the Panel is it's default hideMode, 'display'.

    I submitted a fix, but unfortunately, it's too late to get into beta 1. It will be fixed in 4.1.0 final.

    A workaround is to configure the Panel hideMode: 'offsets'

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Location
    Hyderabad
    Posts
    27
    Vote Rating
    2
      0  

    Default Drag and Drop not working in ExtJs 4.1

    Hi, The drag and drop code working in 4.0.7.
    After I updated to 4.1 Drop is not working.
    Let me know Is there any fix for Drag and Drop in ExtJs4.1

    Thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •