提交 c31e1b7b authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Confirm deletion of rows in web console

上级 969f44a9
......@@ -1675,10 +1675,11 @@ public class WebApp {
"onmouseout = \"this.className ='icon'\" " +
"class=\"icon\" alt=\"${text.resultEdit.edit}\" " +
"title=\"${text.resultEdit.edit}\" border=\"1\"/>").
append("<a href=\"editResult.do?op=2&row=").
append("<img onclick=\"javascript:deleteRow(").
append(rs.getRow()).
append("&jsessionid=${sessionId}\" target=\"h2result\" >" +
"<img width=16 height=16 src=\"ico_remove.gif\" " +
append(",'${sessionId}', '${text.resultEdit.delete}', " +
"'${text.resultEdit.cancel}'").
append(")\" width=16 height=16 src=\"ico_remove.gif\" " +
"onmouseover = \"this.className ='icon_hover'\" " +
"onmouseout = \"this.className ='icon'\" " +
"class=\"icon\" alt=\"${text.resultEdit.delete}\" " +
......
......@@ -82,6 +82,28 @@ function editRow(row, session, write, undo) {
}
}
function deleteRow(row, session, write, undo) {
var table = document.getElementById('editTable');
var y = row < 0 ? table.rows.length - 1 : row;
var i;
for(i=1; i<table.rows.length; i++) {
var cell = table.rows[i].cells[0];
if (i == y) {
var edit = '<img width=16 height=16 src="ico_remove_ok.gif" onclick="deleteOk('+row+')" onmouseover = "this.className =\'icon_hover\'" onmouseout = "this.className=\'icon\'" class="icon" alt="'+write+'" title="'+write+'" border="1"/>';
var undo = '<img width=16 height=16 src="ico_undo.gif" onclick="editCancel('+row+')" onmouseover = "this.className =\'icon_hover\'" onmouseout = "this.className=\'icon\'" class="icon" alt="'+undo+'" title="'+undo+'" border="1"/>';
cell.innerHTML = edit + undo;
} else {
cell.innerHTML = '';
}
}
var cells = table.rows[y].cells;
for (i=1; i<cells.length; i++) {
var s = cells[i].style;
s.color = 'red';
s.textDecoration = 'line-through';
}
}
function editCancel(row) {
var editing = document.getElementById('editing');
editing.row.value = row;
......@@ -96,6 +118,13 @@ function editOk(row) {
editing.submit();
}
function deleteOk(row) {
var editing = document.getElementById('editing');
editing.row.value = row;
editing.op.value='2';
editing.submit();
}
function editKeyDown(row, object, event) {
var key=event.keyCode? event.keyCode : event.charCode;
if (key == 46 && event.ctrlKey) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论