MultiLine Table Headers and ColVis

MultiLine Table Headers and ColVis

cogdencogden Posts: 2Questions: 0Answers: 0
edited October 2010 in Plug-ins
I have table headers that have
tags in them to save space on column width. The problem is when using ColVis, the select menu does not remove this tag and you can't see half of the column title when you are toggling columns on and off. What would be the best way to fix this?

Replies

  • allanallan Posts: 55,045Questions: 1Answers: 8,638 Site admin
    Never thought of that I've got to admit... At the way to fix this would be to modify the HTML that ColVis has created, after initialisation. Looking forward, ColVis should perhaps offer a callback function which would allow a developer to make this modification. Alternatively you could modify the source - line 299 is the one you are looking for.

    Allan
  • cogdencogden Posts: 2Questions: 0Answers: 0
    I see a newer version of ColVis has been released. Does it by change include the above mentioned call back?
  • rubycatrubycat Posts: 9Questions: 0Answers: 0
    Hiya...I seem to have run into the same problem and am bummed because I was so excited about being able to use this functionality in a new project. The line 299 reference has clearly changed--any chance you can revisit this one with more information?
  • allanallan Posts: 55,045Questions: 1Answers: 8,638 Site admin
    The ColVis code at the moment just uses the column titles as are, so it would require a small modification to the ColVis code at the moment - in the function _fnDomColumnButton, there is the line

    [code]
    ''+oColumn.sTitle+''
    [/code]
    if you replace that with:

    [code]
    ''+oColumn.sTitle.replace( /<.*?>/g, "" )+''
    [/code]
    That should do it - although I've not tested it :-)

    Something to think about for a future release - a rendering callback!

    Allan
This discussion has been closed.