首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在mousedown - Sencha ExtJs中存储变量的问题

在mousedown - Sencha ExtJs中存储变量的问题
EN

Stack Overflow用户
提问于 2015-10-08 02:33:44
回答 1查看 49关注 0票数 0

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

提前谢谢你,

代码片段:

代码语言:javascript
运行
复制
    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
}

…
EN

回答 1

Stack Overflow用户

发布于 2015-10-10 04:25:04

我用错了.mon

this.getView().mon(this.getView().getEl(),'mousedown',myFunction,this)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32999895

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档