48 lines
1.4 KiB
R
48 lines
1.4 KiB
R
buchungenUI <- function(id) {
|
|
ns <- NS(id)
|
|
tagList(
|
|
reactableOutput(ns("buchungen_table")),
|
|
reactableOutput(ns("details_table")),
|
|
postingModuleUI(ns("posting_modal"))
|
|
)
|
|
}
|
|
|
|
|
|
buchungenServer <- function(id) {
|
|
moduleServer(id, function(input, output, session) {
|
|
ns <- session$ns
|
|
|
|
postings <- reactiveVal(read_buch_tabelle(conn))
|
|
|
|
# NEU: Eine reactive variable für die ID, die wir editieren wollen
|
|
# current_entry_id <- reactiveVal(NULL)
|
|
|
|
# NEU: Den Modul-Server EINMALIG hier oben starten (nicht im Observer!)
|
|
# entryEditServer("entry_edit", entry_id = current_entry_id, conn = conn)
|
|
|
|
output$buchungen_table <- renderReactable({
|
|
# req(postings())
|
|
f_reactable(postings(), coldefs = coldef_entries_tabelle)
|
|
})
|
|
|
|
# Modal zum editieren
|
|
selected <- reactive(getReactableState("buchungen_table", "selected"))
|
|
|
|
observeEvent(selected(), {
|
|
idwert <- postings()[selected(),"entry_id"] %>% pull
|
|
details <- read_buch_tabelle(conn, trans_id = idwert)
|
|
output$details_table <- renderReactable(
|
|
f_reactable(details, coldefs = coldef_entries_tabelle)
|
|
)
|
|
|
|
})
|
|
|
|
selected_det <- reactive(getReactableState("details_table", "selected"))
|
|
observeEvent(selected_det(),{
|
|
idwert <- postings()[selected(),"id"] %>% pull
|
|
postingModuleServer("posting_modal",conn, idwert)
|
|
})
|
|
|
|
|
|
})
|
|
} |