1

Is there any way to get the current vertical position of a panel while dragging it?

I have something like this:

Ext.define("App.DashboardDrawer",
{
  extend: 'Ext.Panel',
  xtype: 'dashboarddrawer',

  config: {
    cls: 'w-drawer',
    height: '380px',
    zIndex: 99999,
    id: 'drawer-container',
    docked: 'bottom',
    draggable:{
      direction:'vertical',
      constraint: {
        min: { x: 0, y: 0 },
        max: { x: 0, y: 338 }
      }
    },
    listeners:{
      drag: function(list, idx, target, record, evt) {
        // I'd like to get the current position of the panel here

      }
    },
...

Thanks.

eddie.vlagea
  • 667
  • 1
  • 6
  • 18

1 Answers1

1

Try this. It works for me.

        Ext.define('Stackoverflow.view.Demo', {
        extend: 'Ext.Panel',
        alias: 'widget.demo',

        config:
        {  
            draggable:{
              direction:'vertical',
              constraint: {
                min: { x: 0, y: 0 },
                max: { x: 0, y: 338 }
              },
              listeners: {
                    drag: function( draggable, evt, offsetX, offsetY, eOpts ) {
                         console.log( offsetX);
                    }
              }}
        }
        });
Vikal Sharma
  • 555
  • 2
  • 11