Ellipis renderer - HTML Tooltip?

Ellipis renderer - HTML Tooltip?

peterbrownepeterbrowne Posts: 314Questions: 54Answers: 0

Is it possible to have the tooltip for Ellipsis render HTML content?

 columnDefs: [ {
            targets: 1,
            render: $.fn.dataTable.render.ellipsis( 200, true )
            } ],

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @peterbrowne ,

    You can use the ellipsis function within the render function itself, something like this. You can then use that to make the tooltip.

    Cheers,

    Colin

  • peterbrownepeterbrowne Posts: 314Questions: 54Answers: 0

    Thanks Colin, but that doesn't render HTML inside the tooltip. The tooltip contents is still text, not rendered markup.

    I have cloned your example with the following changes to show what I am wanting:

    http://live.datatables.net/xokomuwi/1/edit

    See part in HTML at:

    <tr>
    <td>Angelica Ramos</td>
    <td><ul>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
    </ul>
    </td>
    <td>London</td>
    <td>36</td>
    <td>2009/10/09</td>
    <td>$2,875</td>
    </tr>
    

    So in the tooltip, I want to have the rendered list.

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin
    Answer ✓

    You are correct - the tooltip renderer cannot display HTML content as it uses the title attribute (which you can see here). Thus it is using the browser's built in attribute tooltip, which is not capable of displaying HTML.

    There isn't a workaround I'm afraid - it would require that plug-in to be re-implemented using a Javascript tooltip display.

    Allan

This discussion has been closed.