Okay
  Public Ticket #2969827
Hover over Tooltip
Closed

Comments

  •  1
    Melina started the conversation

    Is it possible to have a hover over tooltip that appears on every cell in a table?

    eg if one of the cells is a "key" of 5 codes i can have have the user hover over the cell and it shows a little "helper" of what each code means? 

  •  1,851
    Miloš replied

    Hi, Melina

    Thanks for reaching out to us.

    It is quite a custom solution, but, with some effort, it can be done. Depends on what kind of functionality you need from this column;

    and all of this requires some level of skill with HTML and CSS.

    For this solution which I made, you won't be able to do some functions, like calculations; it would have to be a string type. You mentioned it will be some codes, so, not sure if this will be ideal, if you need this to be integers or floats, then it won't work.

    I made a string type column, and directly typed in some HTML, a DIV with an ID, with some text inside; then nested a SPAN element inside, with the "hover text" inside that, like this :

    <div id="tooltipwrapper">mainText<span id="tooltiphover">hovertext</span></div>
    
    5796944191.png

    - Basically, this would mean that you would have to manually input the five codes, in all of the cells for that column; if that makes sense. ( Hopefully, I am explaining everything clear enough).

    More about string type columns and their limitations and advantages here - https://wpdatatables.com/documentation/column-features/string-columns/

    Then with some custom CSS, I managed to create a hover text above the field; now, depending on exactly where you want to position it, you can experiment with some styles; I positioned it somewhere at the "middle top" above the cell, and you can choose whether to use px for pixels, or % for percentages of the screen for the values, such as width, positioning, margin, etc.

    div#tooltipwrapper{
        position:relative;
    }
    span#tooltiphover{
    visibility: hidden;
      width: 120px;
      background-color: black;
      color: #fff;
      text-align: center;
      padding: 5px 0;
      border-radius: 6px;
      
      position: absolute;
      z-index: 1;
      bottom: 100%;
        left: 55%;
        margin-left: -100px
    }
    div#tooltipwrapper:hover span#tooltiphover {
        visibility: visible;
    }
    .wpDataTablesWrapper table.wpDataTable td {
        overflow: unset !important;
    }
    
    5157473396.png

    I will also attach a short video, you can see how it looks on my local testing.

    Try this out, and experiment with the styles, to find what could be the best for your project.

    Here is a very useful resource with more information about creating tooltips with CSS - https://www.w3schools.com/css/css_tooltip.asp

    If anything was not clear enough, I apologize, and you can contact us further if you need more details. We will do the best we can to help within the limits of what our support covers.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Melina replied

    Perfect thank you ill add this in. yes its just a string column so that should work great thanks for the awesome support as always :) 

  •  1,851
    Miloš replied

    Thanks, Melina.

    Sounds good; let's see how it goes when you try this out. You can come back to this ticket if the tooltip has any issues when you implement it on your page.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Bendix replied

    Dear TMS / wpDT team,

    This custom solution works pretty well but it would also be a great feature to implement as a regular "tooltip/hover function" which could take one "auxiliary/tooltip column" as input for the tooltip function. In that case it would be great if wpDT users could decide on the behaviour of that column with regard to the export functions (include tooltip column in export tables or not?).

    I have one question regarding this solution, though: Is there a way to make the tooltip text display such that newline characters actually lead to a line break? Or is there a different way to include manual line breaks? I've also tried <br> but it didn't work either.

    Best,
     Bendix

  •  1,851
    Miloš replied

    Hi, Bendix

    - Indeed, this is a bit of an improvised custom solution. Not perfect, or universal for every page, so it does need a lot of improvement before we might implement this as a built-in feature, but I will certainly pass your suggestions to the developers, and depending on other priorities, they will try to put this on their "to-do" list of improvements of the plugin.

    You can also suggest this as a built-in feature on this link https://wpdatatables.com/documentation/feature-suggestion/ and our developers would place it on their "TO-DO" list.

    As more customers request a feature, it gets pushed quicker on the list. We always strive to make our product better and deliver the most value to our end users, so we carefully review each suggestion.

    - As far as exporting table options, these functionalities are based on a 3rd party HTML5 library. There are some limitations in this library, and very little fine-tuning is available at this time; we are doing our best to add more features regarding export, as well. More details about that on our documentation here - https://wpdatatables.com/documentation/table-features/table-tools/

    - And for the additional question for the tooltip : a way to make the tooltip text display such that newline characters actually lead to a line break;

    i am sorry, but what we created so far regarding this is already a very improvised custom solution.

    - What you suggested is beyond the limits of what our support covers, sadly. We can always recommend WP Kraken for custom solutions, but we can't advise on their pricing.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1
    Tymek replied

    Hello,

    Has anything changed after 2+ years? I'm also looking for a solution like this.

  •  1,851
    Miloš replied

    Hi Tymek,

    Unfortunately, when it comes to tooltips on hover, we still don't have any built-in solution and we can't guarantee it would work with a 3rd Party tooltip on hover Plugins/solutions.

    All the 3rd Party tooltips solutions we tried so far are still not working - but if you find any custom workaround, it would be nice to share it with us, it can help our devs for future options.

    If you have coding skills and wish to try to make a custom solution now,

    you can check out our available hooks for Developers on this documentation and see if you can find any hook that might help.

    We also added this new developer's handbook, which can allow users with coding skills to make custom add-ons.

    Our developers will keep adding more custom hooks/examples there over time.

     

    Please be advised that custom solutions with hooks are not included in our support.

    You can also research resources such as Stack Overflow to see if any other user perhaps found a workaround.


    For the time being, the only custom example we have is the one I made before and shared on this ticket.

     

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables