jrowen / rhandsontable

A htmlwidgets implementation of Handsontable.js
http://jrowen.github.io/rhandsontable/
Other
383 stars 148 forks source link

Popover rendering of image on mouse hover as a scaled up image. #402

Open RajBalakrishnan opened 2 years ago

RajBalakrishnan commented 2 years ago

Is it possible to update the renderer function that helps to display image in the table cell to also render a popup message on mouse hover as shown here?

This will help using the rhandsontable for molecular structure rendering besides so many other uses.

renderer = "function(instance, td, tr, row, col, prop, value, cellProperties) { var escaped = Handsontable.helper.stringify(value),img; if (escaped.indexOf('http') === 0) {img = document.createElement('IMG');img.src = value; img.style.width = '150px'; img.style.height = '150px'; Handsontable.dom.addEvent(img, 'mouseover', function (e){e.preventDefault(); }); Handsontable.dom.empty(td);td.appendChild(img);};return td;}"

From Stackoverflow

callback=JS( 'table.on("mouseover","tr", function() { $(".small-img").hover(function(){ $(this).css("transform", "scale(3, 3)"); }, function(){ $(this).css("transform", "none"); }); })'
)