From 546b4e4b57f00389bcc5c010980b84127c056d4a Mon Sep 17 00:00:00 2001 From: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:04:06 -0500 Subject: [PATCH] Save updated status in DOM --- R/shiny.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/shiny.R b/R/shiny.R index 487b150..4a697a9 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -12,6 +12,7 @@ checkbox_callback <- DT::JS( "var rowIdx = table.row($(this).closest('tr')).index();", "var ids = cell.data().ids;", "var review = $(this).is(':indeterminate') ? null : $(this).is(':checked');", + "cell.data().updated = review;", "var info = {review: review, ids: ids, row: tblId + '_row_' + rowIdx};", "Shiny.setInputValue(tblId + '_review_selection:CS.reviewInfo', info);", "})" @@ -20,9 +21,10 @@ checkbox_callback <- DT::JS( checkbox_render <- DT::JS( "function(data, type, row, meta) {", "var reviewed = data.reviewed;", + "var updated = data.updated;", "return ``;", "}" )