In this example, how do I get the data row of index?
I know that I can use the ‘selectRow‘ method and then ‘getSelected’ to get it. But there is a problem here. If multiple rows have been selected in the datagrid, the ‘getSelected’ method does not necessarily get the row that is needed.
function getRowIndex(target){
var tr = $(target).closest('tr.datagrid-row');
return parseInt(tr.attr('datagrid-row-index'));
}
function editrow(target){
var index = getRowIndex(target);
$('#tt').datagrid('beginEdit', index);
//How to get the data row of this index?
}