2016-11-08 6 views
0

このテーブルは光沢があり、「種」という列名に対して1つのヒントのみを追加したい、つまり他の列にはツールヒントがありません。私はすべてのツールヒントを追加する必要がありますが、特定の列の内容をどのように設定できるか分かりません。ツールヒント光沢のあるrenderDataTableを1つの列名につける

shinyApp(
    ui = fluidPage(
    fluidRow(
     column(12, 
      dataTableOutput('table') 
    ) 
    ) 
), 
    server = function(input, output) { 
    output$table <- renderDataTable(iris, options = list(
     pageLength = 5, 
     initComplete = I("function(settings, json) { 
             $('th').each(function(){this.setAttribute('title', 'TEST');}); 
             $('th').tooltip(); 

            }"))) 

          } 
    ) 

答えて

0

私は4番目の列名、つまり「種別」のみについてツールチップを取得するようにコードを修正しました。

library(shiny) 

shinyApp(
    ui = fluidPage(
    fluidRow(
     column(12, 
      dataTableOutput('table') 
    ) 
    ) 
), 
    server = function(input, output) { 
    output$table <- renderDataTable(iris, options = list(
     pageLength = 5, 
     initComplete = I("function(settings, json) { 
         $('th:eq(4)').each(function(){this.setAttribute('title', 'TEST');}); 
         $('th').tooltip(); 

    }"))) 

    } 
    ) 

関連する問題