Ellipis renderer - HTML Tooltip?

Ellipis renderer - HTML Tooltip?

peterbrownepeterbrowne Posts: 45Questions: 12Answers: 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: 6,526Questions: 0Answers: 1,122

    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: 45Questions: 12Answers: 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: 50,737Questions: 1Answers: 7,581 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

Sign In or Register to comment.