pre-existing span within the header - need to target datatables inserted span

pre-existing span within the header - need to target datatables inserted span

luke.chardeluke.charde Posts: 1Questions: 0Answers: 0
edited April 2011 in Bug reports
I have had the issue of our framework (JSF) adding spans within the table header - sometimes this cannot be prevented. Datatables inserts spans into the header and then targets them for sorting. The pre-existing spans are also being acted upon by Datatables.

@Allan, There may be a much more elegant way to fix, but here is what we did. Would a fix for this type of situation be something that could be rolled into Datatables?

Line 2947
[code]
var sortSpan = document.createElement( 'span' );
sortSpan.className = "sortHeaderSpan";
nDiv.appendChild( sortSpan );
[/code]

line 4644(4646)
[code]
var jqSpan = $("span.sortHeaderSpan",
oSettings.aoColumns[i].nTh);
[/code]

Replies

  • Levi MorrisonLevi Morrison Posts: 1Questions: 0Answers: 0
    I had to do the same thing just today. I used the class 'arrow', but 'sortHeaderSpan' makes more sense.

    This really is not a minor bug, either. Using a plain, generic tag in something like dataTables easily leads to errors like this quite easily. This should be fixed.
This discussion has been closed.