Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.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
Javascript 在mousedown-Sencha ExtJs中存储变量时出现问题_Javascript_Extjs_Mousedown - Fatal编程技术网

Javascript 在mousedown-Sencha ExtJs中存储变量时出现问题

Javascript 在mousedown-Sencha ExtJs中存储变量时出现问题,javascript,extjs,mousedown,Javascript,Extjs,Mousedown,我在组件类中传递所需变量时遇到问题。问题是,当单击微调时,再次调用该类,并且当前光标位置被设置回“未定义”。我还没有找到另一种方法来注册鼠标下击。似乎我在共享变量之间有一个真正的问题。有什么建议吗 提前感谢, 代码段: current_cursor_position: undefined, //global variable to hold the cursor position that is used when spinUp is click. Also is used to sto

我在组件类中传递所需变量时遇到问题。问题是,当单击微调时,再次调用该类,并且当前光标位置被设置回“未定义”。我还没有找到另一种方法来注册鼠标下击。似乎我在共享变量之间有一个真正的问题。有什么建议吗

提前感谢,

代码段:

    current_cursor_position: undefined, //global variable to hold the cursor position that is used when spinUp is click. Also is used to store mouse down position 

init{
        this.getView().addListener('spinup', this.spinnerUp, this);
        this.getView().addListener('spindown', this.spinnerDown, this);

        this.getView().mon(this.getView().getEl(), {
        mousedown: function(e) {

          this.current_cursor_position = //logic to find and store user current mouse click
        }
},

spinnerUp {
this.current_cursor_position = //recorded cursor position 
…
//logic to increment time
}

…

我用错了


this.getView.monthis.getView.getEl,'mousedown',myFunction,这个

你在mousedown上的作用域是什么?似乎这个作用域只在init中