54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
var table = document.getElementById('idList');
|
|
var selected = table.getElementsByClassName('selected');
|
|
var selectedId = 'None';
|
|
table.onclick = highlight;
|
|
|
|
function select(category, mode) {
|
|
var id = selectedId;
|
|
if (id == 'None')
|
|
{
|
|
alert("Kein Eintrag ausgewaehlt!");
|
|
}
|
|
else
|
|
{
|
|
if(mode == 0) {
|
|
window.location.href = '/detail/?cat=' + category + '&id=' + id;
|
|
}
|
|
if(mode == 1) {
|
|
var result = confirm("Sind Sie sicher, dass der Eintrag gelöscht werden soll?");
|
|
if(result) {
|
|
window.location.href = '/delete/?cat=' + category + '&id=' + id;
|
|
return true;
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
}
|
|
if(mode == 2) {
|
|
var result = confirm("Sind Sie sicher, dass das Angebot angenommen werden soll?");
|
|
if(result) {
|
|
window.location.href = '/detailchoice/?id=' + id;
|
|
return true;
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function highlight(e) {
|
|
if (selected[0]) selected[0].className = '';
|
|
e.target.parentNode.className = 'selected';
|
|
<<<<<<< HEAD
|
|
var tr = e.target.parentNode;
|
|
=======
|
|
<<<<<<< HEAD
|
|
var tr = e.target.parentNode;
|
|
=======
|
|
var tr = event_opl.target.parentNode;
|
|
>>>>>>> 8825fc510535fc545cb82dcdf3e43792144e6d2e
|
|
>>>>>>> b2f022ec66108999eed47f8683cae851793ff6c1
|
|
selectedId = tr.getAttribute('id');
|
|
} |