I'm pretty sure this is nothing but as I'm new with coding I'm struggling with this problem. I'm trying to make my table navigable with arrows but when I use an arrow it just doesn't work. It seems to be because of a TypeError but I can't succeed to understand what's going wrong. If anyone could explain that would be great !
Problem seems to come from line 60. This problem started with the fact I was using DataTable script. I then had these lines at the beginning of the js file :
// DataTable //
var table = $('#mytable').DataTable( {
"paging": false,
"searching": false,
"info": false,
fixedHeader: true,
colReorder: true,
stateSave: true,
});
But I wanted to remove that script to not depend about anything else (I'm learning by trying to do everything myself). So I tried to replace it with some vars, but unsuccessfully so far. My highlight function looked like this with DataTable :
function highlight() {
document.querySelectorAll('.highlight-rc').forEach(col => col.classList.remove('highlight-rc'));
var colIdx = table.cell(c).index().column;
$(table.cells().nodes()).removeClass('highlight-rc');
$(table.column(colIdx).nodes()).addClass('highlight-rc');
currCell.removeClass('highlight');
c.addClass('highlight');
currCell.parent().removeClass('highlight-rc');
c.parent().addClass('highlight-rc');
}
Thanks in advance for your kind help. Sincerely,