Skip to content

Commit

Permalink
fix(145): Fix app the work as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Dec 8, 2023
1 parent a40ae84 commit 4539607
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions inst/apps/145-dt-replacedata/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,28 @@ dtmod_ui <- function(id) {
dtmod <- function(input, output, session) {
x <- reactiveVal(0L)

df <- reactive({
data.frame(value = x())
})

output$table <- renderDT({
DT::datatable(data.frame(value = isolate(x())), rownames = FALSE, options = list(dom = "t", ordering = FALSE))
DT::datatable(
isolate(df()),
rownames = FALSE,
options = list(dom = "t", ordering = FALSE)
)
})

observeEvent(input$inc, {
x(x() + 1L)
})

observeEvent(x(), {
replaceData(dataTableProxy("table"), x())
replaceData(
dataTableProxy("table"),
df(),
rownames = FALSE
)
})

x
Expand Down

0 comments on commit 4539607

Please sign in to comment.