1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    2
    Vote Rating
    0
    newsAnand is on a distinguished road

      0  

    Default panel drag and drop is not working in extjs 4.1

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,346
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      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
    24
    Vote Rating
    2
    shilpay is on a distinguished road

      0  

    Default Drag and Drop not working in ExtJs 4.1

    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.