rstudio / shiny

Easy interactive web applications with R
http://shiny.rstudio.com
Other
5.31k stars 1.87k forks source link

reactive depend on input$table_rows_selected and input$table_rows_all #1021

Closed glfeng318 closed 7 years ago

glfeng318 commented 8 years ago

the shiny app has two reactives, two datatables. one of the reactives using input$auction_rows_selected and input$auction_rows_all(auction is the name of one datatable) to filter data and make a datatable(named keyword).

  keywordFilter <- reactive({
    auction = auctionFilter()
    s = input$auction_rows_all
    if (!is.null(input$auction_rows_selected)) {
      s = c(9999999999, input$auction_rows_selected)
    }
    if (is.null(s)) {
      s = c(9999999999, 9999999999)
    }
    aid = local(auction$auction_id[s])
    ysf_auction_keywords_view %>%
      filter(
        shop_name == input$shop,
        impression>0,
        auction_id %in% aid
      )
})

when i open the app in chrome, it generates two datatables(auction and keyword) first, and then keyword datatable will refresh immediately when datatable auction is drawed. is there is way to avoid this refresh at page loadding?

wch commented 7 years ago

Sorry for not responding in a long time. This is a question better suited for Stack Overflow or the shiny-discuss mailing list.