Error in "DataTables highlighting example"
Error in "DataTables highlighting example"
adsood
Posts: 10Questions: 0Answers: 0
Hi there,
I was looking for a highlight row axample and noticed that "DataTables highlighting example" ( http://datatables.net/release-datatables/examples/api/highlight.html ) displays wrong column as highlighted.
It actually highlights the column next after the one where mouse cursor is located.
If the cursor is on the last column, datatable highlights the first column.
I am not sure if there is a bug in the core or the example has it, but anyway want to bring your attention to it.
I was looking for a highlight row axample and noticed that "DataTables highlighting example" ( http://datatables.net/release-datatables/examples/api/highlight.html ) displays wrong column as highlighted.
It actually highlights the column next after the one where mouse cursor is located.
If the cursor is on the last column, datatable highlights the first column.
I am not sure if there is a bug in the core or the example has it, but anyway want to bring your attention to it.
This discussion has been closed.
Replies
[code]
$('td:nth-child('+(iCol+1)+')', nTrs)
[/code]
that +1 has no business being there...! I'll get this fixed - thanks for the heads up!
Allan
Allan
[code]
$('td').index(this);
[/code]
should have been:
[code]
$('td', this.parentNode).index(this);
[/code]
Doh! Its a wonder it was only off by one column... Example fixed and commit just about to go to github. Weirdly it worked on my local server, but not datatables.net - can't explain that. However, both happy now!
Thanks for spotting that!
Allan