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中