columnText renders text, not html, when using colReorder and colVis and bootstrap

columnText renders text, not html, when using colReorder and colVis and bootstrap

morrbomorrbo Posts: 13Questions: 5Answers: 0

Demo: https://jsfiddle.net/friek2k/fjwjfuxL/

In this demo, on first load, columnText appropriately renders the supplied html as html. However, if you try re-ordering the columns, then opening the columns dropdown again, the buttons are echoed as text - i.e. the html isn't rendered.

Any suggestions on how to remediate?

Thanks a lot

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Thanks for the example, but that doesn't include ColReorder, and it's not Bootstrap. Please could you update it and provide instructions on how to demonstrate the issue.

    Colin

  • morrbomorrbo Posts: 13Questions: 5Answers: 0

    I forgot to save the fiddle before linking d'oh.

    Please see this updated version:

    https://jsfiddle.net/of39st5r/

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Thanks for that test case, that helped. I can see the issue, and yep, agreed, it looks wobbly. I've raised it internally (DD-1348 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • morrbomorrbo Posts: 13Questions: 5Answers: 0
    edited January 2020

    Great - thanks a lot Colin. Actually a bit surprised it's never been flagged before!

    Cheers

  • terracattaterracatta Posts: 2Questions: 0Answers: 0

    Just wanted to chime in and say a user reported this in our environment as well. I feel like I tested this throughly when I first implemented colreorder, so I have to imagine there was a regression in core datatables, as we have not updated the colreorder plugin since building our product.

    If I end up bisecting through and finding what caused the regression, I will report back here...

  • morrbomorrbo Posts: 13Questions: 5Answers: 0

    On that note Colin, has there been any progress on finding a fix at all?

    Thanks very much

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Unfortunately not, we're heads down on another project right now, so haven't been able to spend any time on this. I've flagged it for next release, though I can't guarantee when that would be.

    Colin

  • morrbomorrbo Posts: 13Questions: 5Answers: 0

    Ok no problem - thanks for getting back to me

  • terracattaterracatta Posts: 2Questions: 0Answers: 0

    I ended up not finding a regression, I think this bug has been here since I started my project in early 2019. What I ended up doing was using psudeo selectors (:before and :after) in CSS to get the DOM structure I needed vs relying on passing html directly. This allowed me to pass simple text again but still style things how I wanted.

  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin
    Answer ✓

    Just to say that this issue has been fixed by this commit which will be included in the next Buttons release, which will drop soon.

    Allan

This discussion has been closed.