dev/row-hover-callback.R

library(shiny)
library(DT)

shinyApp(
  ui = fluidPage(
    DT::dataTableOutput("mtcarsTable")
  ),
  server = function(input, output) {

    output$mtcarsTable <- DT::renderDataTable({
      DT::datatable(datasets::mtcars[,1:3],
                    options = list(rowCallback = JS(
                      "function(row,data,displayIndex,displayIndexFull) {",
                        "for (var i = 0; i < 5; i++) {",
                          "var full_text = data;",
                          "$('td', row).attr('title', full_text);",
                        "}",
                      "}")
                    )
      )

    })
  }
)
teofiln/gene.editing.dash documentation built on Feb. 21, 2022, 12:59 a.m.