23 lines
577 B
JavaScript
23 lines
577 B
JavaScript
|
var table = document.getElementById('idList');
|
||
|
var selected = table.getElementsByClassName('selected');
|
||
|
var selectedId = 'None';
|
||
|
table.onclick = highlight;
|
||
|
|
||
|
function select(category) {
|
||
|
var id = selectedId;
|
||
|
if (id == 'None')
|
||
|
{
|
||
|
alert("Kein Eintrag ausgewaehlt!");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
window.location.href = '/detail/?cat=' + category + '&id=' + id;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function highlight(e) {
|
||
|
if (selected[0]) selected[0].className = '';
|
||
|
e.target.parentNode.className = 'selected';
|
||
|
var tr = e.target.parentNode;
|
||
|
selectedId = tr.getAttribute('id');
|
||
|
}
|