0
我想从dataEvents
事件中检索用户输入的值。我只想让数字0-24,如果用户插入数字如4,5(德语写作),我想用“。”替换“,”。因此将“4,5”转换为“4.5”。jqgrid检索单元格数据并对其进行操作
但我很努力地获取用户输入的数据。我使用的方法总是返回空白。
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
}
}
]
}
},
],
奥列格,这真棒!我会在一会儿尝试一下,但现场演示(哇,现场演示)已经是我正在寻找的! – 2010-12-10 11:45:45
谢谢奥列格。它工作得很好!你救了我的周末;-) – 2010-12-10 12:20:24
@汤姆汤姆:你很欢迎!周末愉快! – Oleg 2010-12-10 12:37:30