【发布时间】:2011-05-23 09:05:00
【问题描述】:
我想从dataEvents 事件中检索用户输入的值。我只想允许数字 0-24,如果用户插入像 4,5(德语写作)这样的数字,我想用“。”替换“,”。因此将“4,5”转换为“4.5”。
但我正在努力获取用户输入的数据。我使用的方法总是返回空白。
colModel:[
{name:'sum',index:'sum', width:45, editable: true, sortable:false,
editoptions: { dataEvents: [
{
type: 'keypress', // keydown
fn: function(e) {
// console.log('keypress');
var v=$(e.target).text();
alert(v); // v is empty.
//reset the target value, actually I want to replace
// enter code here a comma with a point
// only allow the numbers 0 - 24
}
}
]
}
},
],
【问题讨论】: