EVOLUTION-MANAGER
Edit File: removeEvent.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Remove an event that was added to an element</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for removeEvent {shinyjs}"><tr><td>removeEvent {shinyjs}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Remove an event that was added to an element</h2> <h3>Description</h3> <p>This function can be used to revert the action of <code><a href="onclick.html">onclick</a></code> or <code><a href="onevent.html">onevent</a></code>. </p> <h3>Usage</h3> <pre> removeEvent(event, id, asis = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>event</code></td> <td> <p>Either an event type (see below for a list of event types) or an event ID (the return value from <code><a href="onclick.html">onclick</a></code> or <code><a href="onevent.html">onevent</a></code>). If an event type is provided (eg. "hover"), then all events of this type attached to the given element will be removed. If an event ID is provided, then only that specific event will be removed. See examples for clarification.</p> </td></tr> <tr valign="top"><td><code>id</code></td> <td> <p>The ID of the element/Shiny tag. Must match the ID used in <code><a href="onclick.html">onclick</a></code> or <code><a href="onevent.html">onevent</a></code>.</p> </td></tr> <tr valign="top"><td><code>asis</code></td> <td> <p>If <code>TRUE</code>, use the ID as-is even when inside a module (instead of adding the namespace prefix to the ID).</p> </td></tr> </table> <h3>Event types</h3> <p>Any standard <a href="https://api.jquery.com/category/events/mouse-events/">mouse</a> or <a href="https://api.jquery.com/category/events/keyboard-events/">keyboard</a> events that are supported by JQuery can be used. The standard list of events that can be used is: <code>click</code>, <code>dblclick</code>, <code>hover</code>, <code>mousedown</code>, <code>mouseenter</code>, <code>mouseleave</code>, <code>mousemove</code>, <code>mouseout</code>, <code>mouseover</code>, <code>mouseup</code>, <code>keydown</code>, <code>keypress</code>, <code>keyup</code>. You can also use any other non standard events that your browser supports or with the use of plugins (for example, there is a <a href="https://github.com/jquery/jquery-mousewheel">mousewheel</a> plugin that you can use to listen to mousewheel events). </p> <h3>See Also</h3> <p><code><a href="onclick.html">onclick</a></code>, <code><a href="onevent.html">onevent</a></code> </p> <h3>Examples</h3> <pre> if (interactive()) { library(shiny) shinyApp( ui = fluidPage( useShinyjs(), # Set up shinyjs p(id = "myel", "Hover over me to see the date, the time, and a random integer"), actionButton("remove_date", "Remove date hover event"), actionButton("remove_all", "Remove all hover events") ), server = function(input, output) { onevent("hover", "myel", print(format(Sys.time(), "%H:%M:%S"))) onevent("hover", "myel", print(sample(100, 1)), add = TRUE) date_event_id <- onevent("hover", "myel", print(as.character(Sys.Date())), add = TRUE) observeEvent(input$remove_all, { removeEvent("hover", "myel") }) observeEvent(input$remove_date, { removeEvent(date_event_id, "myel") }) } ) } </pre> <hr /><div style="text-align: center;">[Package <em>shinyjs</em> version 2.1.0 <a href="00Index.html">Index</a>]</div> </body></html>