I have a dataframe with a column full of NAs and I want to be able to fill those NAs but the search filter of the landman column still remains deactivated. Is there a way to update the dataset I use every time I put a value in the landman column and use a submitButton to update it?
library(shiny)
library(shinydashboard)
library(DT)
d <- structure(list(owner = c(
"7 MILL IRON RANCH LLC", "7/S LAND & CATTLE COMPANY LLC",
"AHL/KENNETH L(TRUSTEE & JOHN E AHL ETAL"
), acres = c(
1900.6207117,
654.7908393, 641.3866548
), n = c(5L, 2L, 1L), landman = c(
NA_character_,
NA_character_, NA_character_
)), row.names = c(NA, -3L), class = c(
"tbl_df",
"tbl", "data.frame"
))
#d$landman <- letters[1:3]
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
selectInput("sel","select",choices = d$owner,multiple=T,selected = d$owner[1])
),
dashboardBody(
dataTableOutput("TABLE"),
)
)
server <- (function(input, output, session) {
observeEvent(input$TABLE_cell_edit, {
d <<- editData(d, input$TABLE_cell_edit, 'TABLE')
})
output$TABLE <- renderDataTable({
input$TABLE_cell_edit
d<-subset(d,d$owner%in%input$sel)
datatable(d,
filter = "top", editable = "cell", class = "hover cell-border stripe",
caption = "Owners wit more than 500 aggregated accrs",
extensions = "Buttons",
options = list(
dom = "Bfrtip",
buttons = c("copy", "csv", "excel")
)
)
})
})
shinyApp(ui, server)
