row tooltiptext with extended data

row tooltiptext with extended data

LapointeLapointe Posts: 430Questions: 81Answers: 4

Hello all
I'd like to display (on fly) for each row a dynamic tooltip containing some row data values .
Does somebody have an idea please ?
Thanks by advance

Replies

  • kthorngrenkthorngren Posts: 20,342Questions: 26Answers: 4,775

    I've used columns.render for this. Here is a code snippet from one of my projects.

                        render: function (data, type, row) {
                            if (type === 'display') {
                                var title = ' title="Unknown Attribute"';
                                if (statusMap.hasOwnProperty(data)) {
                                    title = ' title="' + statusMap[data] + '"';
                                }
                                return '<span' + title + '>' + data + '</span>';
                            }
                            return data;
                        }
    

    Kevin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Thanks

    In fact what I need is to display information when onmouseover (fly) in a tooltip box

  • kthorngrenkthorngren Posts: 20,342Questions: 26Answers: 4,775

    display information when onmouseover (fly) in a tooltip box

    I'm not clear on what you mean. The above code displays tooltips when hovering over that column. Here is a simplified example of the above code:
    http://live.datatables.net/bafagavu/1/edit

    Is this what you are looking for?

    If you want something different you can simply return the HTML you want in columns.render.

    Kevin

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    I understand .
    I need the same tooltip content for each row, displaying hidden data in the tooltip box, at the mouse place.

    This code do what I was searching for row level

    $('#data').on( 'mouseover','tbody tr', function (e) {
        var t = table.row( this ).data();
        this.title = t.dataArrayName.dataFieldName;
        } );    
    

    Thanks for your help

  • tefdattefdat Posts: 42Questions: 7Answers: 3

    @Lapointe, I am looking for the exactly same solution.
    Just showing a kind of a table as tooltip for the hidden columns.
    Were you able to find a solution?

  • colincolin Posts: 15,158Questions: 1Answers: 2,587

    This example from this thread shows how you can use a hidden column for the tooltip data,

    Colin

This discussion has been closed.