Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch stopEvent()不处理拖动事件_Sencha Touch_Extjs_Sencha Touch 2 - Fatal编程技术网

Sencha touch stopEvent()不处理拖动事件

Sencha touch stopEvent()不处理拖动事件,sencha-touch,extjs,sencha-touch-2,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,

我有一个容器,我在它的配置中用它来拖拽:

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

但没有一个成功。有人知道为什么吗?

我终于将dragstart事件更改为

dragstart: {
  fn: function(){

  },
  order: 'before'
},

并返回false;工作正常…

您是否在dragstart或drag事件中尝试了panel.firevent'dragend'或其同类功能?我认为firevent函数无法在panel对象上工作,是吗?