Hello, I have a problem with datagrid. When I'm trying to edit a row in a datagrid table the entire page scrolls up so I can't see the raw I want to edit and I need to scroll the page down. I use formatter with the following code:
function formatAction(value,row,index){
if (row.editing){
var s = '<a href="#" onclick="saverow(this)">Save</a> ';
var c = '<a href="#" onclick="cancelrow(this)">Cancel</a>';
return s+c;
} else {
var e = '<a href="#" onclick="editrow(this)">Edit</a> ';
return e;
}
}
and an edit function:
function editrow(target){
var rows = $('#productTable').datagrid('getRows');
var row = rows[getRowIndex(target)];
$.ajax({
url: 'getVolume.php?product=' + row.name,
success: function(data) {
var col = $('#productTable').datagrid('getColumnOption', 'volume');
col.editor.options.data = eval(data);
if (row.isProduct == 'true')
$('#productTable').datagrid('beginEdit', getRowIndex(target));
}
});
}
So how can I set the focus on the row I'm editing? I've read this topic (
https://www.jeasyui.com/forum/index.php?action=printpage;topic=3138.0) and I can set a focus on the selected row, but I still cant see this row and I need to sroll down the page.