在mousedown - Sencha ExtJs中存储变量的问题
Issue with storing a variable in mousedown - Sencha ExtJs
我在组件类中传递所需变量时遇到问题。问题是当spinup被点击时,类被再次调用,current_cursor_position被设置回"未定义"。我还没有找到另一种方法来注册鼠标点击。似乎我有共享变量之间的一个真正的问题。你有什么推荐吗?
提前感谢,
代码片段:
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
}
…
我用错了。mon
this. getview ().mon(this. getview ().getEl(), 'mousedown', myFunction,this)
相关文章:
- 使用javascript存储变量的最安全方式
- 如何在Javascript中为不同的页面访问存储变量
- Javascript 会话存储变量未正确保存
- 服务中的角度存储变量
- 在文本字段中显示保存的本地存储变量 - javascript
- 带有本地存储变量的 jQuery 循环不起作用
- 单击“在时间存储变量”按钮,以便在触发 ajaxComplete 事件时使用
- 页面刷新后的 Javascript 存储变量
- 如何存储变量中单击的子项
- 如何获取不同选项卡的实例,以便我可以存储变量/执行特定于各个选项卡的操作
- 如何使用 jquery 使用本地存储变量设置输入字段
- 无法检索本地存储变量
- 显示本地存储变量
- HTML5会话存储:变量未存储在<李>onclick属性
- 在HTML或Javascript中,如何为每个人存储变量
- SeleniumIDE替换存储变量中的字符串
- JQuery设置本地存储变量
- 在服务AngularJS中存储变量
- 如何使用存储变量和随机数与硒ide
- 计算器Javascript/Jquery存储变量