Bug with Column Visibility buttons text

Bug with Column Visibility buttons text

lisarushlisarush Posts: 102Questions: 17Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

The Toggle buttons that get created in the list for Column Visibility are created multi-line and including any HTML from the column header. Those items should be stripped so the Toggle button only includes the header 'text'.
I believe a change to the following line will fix it:

_columnText: function ( dt, conf ) {
     ...
     title = title.replace( "all the replacement lines here..." );    // needs assignment
     ...
}

Replies

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

    Hi,

    Thanks for posting this up. Sometimes it is actually useful to keep the HTML - e.g. strong or em tags. But yes, I take the point that it isn't always wanted.

    Can you show me an example of the HTML you are using for your thead?

    Thanks,
    Allan

  • lisarushlisarush Posts: 102Questions: 17Answers: 0

    I would think you would just want the Button styled the same as other buttons.
    Also, why have all the code to replace all the HTML, but not use it? It's essentially an extraneous line otherwise.

    Here are a couple examples of <th> tags:

    <th>Duration<br>(days HH:mm)</th> (<br> to keep the column narrower) So, the second line would display somewhat between/behind the buttons in Column Visibility list.

    <th><a target="_blank" href="/linkToGraph">iBW</a></th> (column header is also a link to a Graph for the entries in the column) So, in this case, we definitely don't want the link on the button.

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

    Ah! Do you mean here? In which case, yes, I fully agree. That is missing the assignment. Thanks for pointing that out.

    Fix committed.

    Allan

  • lisarushlisarush Posts: 102Questions: 17Answers: 0

    Yes, exactly.

This discussion has been closed.