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

    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
    38,546
    Vote Rating
    1120
    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 Software Engineer
    ________________
    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,568
    Vote Rating
    55
    Animal will become famous soon enough Animal will become famous soon enough

      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
    shilpay is on a distinguished road

      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.