mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Trigger shiny:recalculated after the calculation is done
This commit is contained in:
@@ -471,7 +471,9 @@ ShinySession <- R6Class(
|
||||
|
||||
obs <- observe({
|
||||
|
||||
self$sendCustomMessage('recalculating', list(name = name))
|
||||
self$sendCustomMessage('recalculating', list(
|
||||
name = name, status = 'recalculating'
|
||||
))
|
||||
|
||||
value <- try(
|
||||
{
|
||||
@@ -493,6 +495,10 @@ ShinySession <- R6Class(
|
||||
silent=FALSE
|
||||
)
|
||||
|
||||
self$sendCustomMessage('recalculating', list(
|
||||
name = name, status = 'recalculated'
|
||||
))
|
||||
|
||||
private$invalidatedOutputErrors$remove(name)
|
||||
private$invalidatedOutputValues$remove(name)
|
||||
|
||||
|
||||
@@ -508,10 +508,11 @@ var ShinyApp = function() {
|
||||
});
|
||||
|
||||
addCustomMessageHandler('recalculating', function(message) {
|
||||
if (message.hasOwnProperty('name')) return;
|
||||
$('#' + message.name).trigger({
|
||||
type: 'shiny:recalculating'
|
||||
});
|
||||
if (message.hasOwnProperty('name') && message.hasOwnProperty('status')) {
|
||||
$('#' + message.name).trigger({
|
||||
type: 'shiny:' + message.status
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user