stopEvent()无法处理拖动事件

时间:2012-05-22 16:39:38

标签: sencha-touch extjs sencha-touch-2

我有一个容器,我在其配置中使用了这个容器:

draggable: {
  direction: 'horizontal',
  constraint: {
      min: { x: 0, y: 0 },
      max: { x: parseInt(screen.width-57), y: 0 }
  },
  listeners: {
    dragstart: function(panel, e, offset){

    },
    drag: function(panel, e, offset){

    },
    dragend: function(panel, e, offset){

    },
    scope: this
  },
}

工作正常。现在我想阻止用户在触发拖动事件时拖动面板。这可能听起来很愚蠢但是,这是为了防止用户直接拖动面板,他必须将手指放在工具栏上以拖动面板。

我已经尝试了一些像

这样的东西
return false;
e.stopEvent();
e.stopPropagation();
e.preventDefault();

但他们都没有奏效。有谁知道为什么?

1 个答案:

答案 0 :(得分:0)

我终于将dragstart事件更改为

dragstart: {
  fn: function(){

  },
  order: 'before'
},

return false;工作得很好......

相关问题