trying to add some "friendliness" to a grid, where when clicking a row the clicked cell gets focus, and also when pressing enter it ends editing. code excerpt below.
This works for editor type=text, but does not for numberbox. the box does not get focus, and keydown event does not register at all, no output on console for any key press on numberboxs. is there a work around?
$("#data").datagrid({
onBeginEdit: function(rowIndex, rowData) {
$.each($('#data').datagrid('getEditors', rowIndex), function(i, o) {
$(o.target).on('keydown', function(e){
console.log(e.keyCode);
switch(e.keyCode) {
case 13: //
$('#data').datagrid('endEdit', rowIndex);
}
});
});
},
onClickCell: function(i,f,v) {
setTimeout(function() {
$($('#data').datagrid('getEditor', {index:i,field:f}).target).focus();
}, 100);
}
});