这是我的第一个帖子,如果需要的话,我可以补充更多的细节。
我希望得到光标的xy位置时,无论是小时,分钟或秒单击。我希望使用步进的位置采取相应的行动。当前代码只是以undefined作为响应。我得到未定义,因为我使用extjs 4.2.2
{
xtype: 'spinnerfield',
itemId: 'time',
name: 'intime',
width: 125,
listeners: {
mousemove: {
element: 'el',
fn: function(e){
var event = e.event;
console.log(event.clientX);
}
}
},
step:1,
value:"11:11:21",
您可以为el
(或inputEl
)添加mousemove
事件侦听器,例如:
xtype: 'textfield',
listeners: {
mousemove: {
element: 'el',
fn: function(e){
console.log(e.event);
}
}
}
工作示例:https://fiddle.sencha.com/#fiddle/uke
Stack Overflow是惊人的!这两天我绞尽脑汁想弄明白这事。多亏了@CD。我可以使用mousedown:
来确定单击框中的位置,并使用event.clientX
来捕获X位置。在extjs 4.2.2中你可以使用e.getX()