You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, great package!
Is there a way to update the table style without re-rendering the table?
I have a large table and re-rendering the table for a change to css styles removes scroll position and takes time.
You can see what I tried below. But I am missing the javascript setStyle function.
Thank you
library(excelR)
library(shiny)
library(shinyjs)
shinyApp(
ui = fluidPage(
useShinyjs(),
actionButton('rerender_to_style', 'Re-render style'),
actionButton('update_style', 'Add style'),
excelOutput("table")
),
server = function(input, output, session) {
output$table <- renderExcel(excelTable(data = head(iris)))
# re-render to update style. this works but is not efficient, especially for large tables
observeEvent(input$rerender_to_style, {
style = list(A1='background-color:orange; color:green;')
output$table <- renderExcel(excelTable(data = head(iris), style = style))
})
# add style with javascript. not working as missing the setSyle function
observeEvent(input$update_style, {
runjs("$('#table').jexcel('setSyle', [ { B1:'background-color:red' } ]);")
})
}
)
The text was updated successfully, but these errors were encountered:
Hey, great package!
Is there a way to update the table style without re-rendering the table?
I have a large table and re-rendering the table for a change to css styles removes scroll position and takes time.
You can see what I tried below. But I am missing the javascript setStyle function.
Thank you
The text was updated successfully, but these errors were encountered: