Strange sorting behaviour on anchor links with tooltips

Strange sorting behaviour on anchor links with tooltips

ajry7cwjr38ajry7cwjr38 Posts: 1Questions: 1Answers: 0
edited May 30 in Free community support

I have inherited a legacy project that makes heavy use of Datatables 1.9.1. I am unable to upgrade as of yet but have some bugs to fix.

I have a simple table with mutliple columns of different types that are all sorted as expected and I am able to change the sorting order when clicking on table headers.

However there is one column that contains <a> anchor links with tooltips like so:

<a id="product" title=${row.ProductTooltip} href="www.somesite.com">
A Product Name
</a>

The issue is the 'title' attribute on the anchor link. When I include this (standard HTML/JS way of adding tooltips), Datatables begins to sort this column on the tooltip/title value instead of the actual value within the <a> tags (A Product Name),

I don't seem to be able to force Datatables to sort on the 'A Product Name' value without eliminating the 'title' attribute entirely, which breaks the tooltip.

Can anyone explain to me why this is happening? As far as I understand it, Datatables should not be sorting on 'title' attribute at all, but it definitely is in this case.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Happy to look at a test case that I can debug.

    Allan

Sign In or Register to comment.