Hi Nathan teetor,
First of all thank you for the reply!. Well, it would be great if you can elaborate more on the fix. Here is the revised code as instructed in your reply. But when I run this code in RSTUDIO then it can't find function list_tc_codes_city_wise (Warning: Error in list_tc_codes_city_wise: could not find function "list_tc_codes_city_wise"
[No stack trace available]). I have wrapped ListTcCodesCityWise.R file code in a function named list_tc_codes_city_wise. I am missing anything?
setwd("C:/Users/gurprees/Documents/Rsmartpack/")
source("ListTcCodesCityWise.R")
ui <- basicPage(
DTOutput("dtable")
)
server <- function(input, output, session){
output$dtable <- renderDT(
datatable(CustomerReport,
extensions = 'Buttons',
options = list(
dom = 'Bfrtip',
buttons = list(
"copy",
list(
extend = "collection",
text = 'test',
action = DT::JS("function ( e, dt, node, config ) {
Shiny.setInputValue('test', true);
}")
)
)
)
)
)
observeEvent(input$test, {
if(input$test){
list_tc_codes_city_wise()
}
})
}
shinyApp(ui, server)