r - Shiny: adding addPopover to actionLink -


i want include small "help" actionlink (next "render" actionbutton) acts popover (see here). here's code:

server.r:

shinyui(pagewithsidebar(   sidebarpanel(      actionbutton("renderbutton", "render"),     actionlink("link", "help") ),   mainpanel() )) 

ui.r:

shinyserver(function(input, output, session) {    # ... dealing renderbutton ...    output$link <- renderui({    addpopover(session=session, id=output$link, title="",                content="testing.", placement = "bottom",               trigger = "click", options = null)    }) }) 

right now, actionlink shows on sidebar, clicking on has no effect. tips? think may have id in addpopover, haven't found many examples provide framework. found this, want deal popover in server.r, not ui.r. can done way, or should make popover in ui.r?

from ?tooltips_and_popovers:

there must @ least 1 shinybs component in ui of app in order necessary dependencies loaded. because of this, addtooltip , addpopover not work if shinybs components in app.

to pop on work, can change actionbutton bsbutton, , modify server.r contain call addpopover. id argument addpopover needs changed refer id of ui object want pop on appear on, in case "link", id of actionlink .

here's modified example code in self-contained code chunk:

library(shiny) library(shinybs)  runapp(   # ui   list(ui = pagewithsidebar(     headerpanel("test app"),      sidebarpanel(        bsbutton("renderbutton", "render"),       actionlink("link", "help") ),      mainpanel("hello world!")   ),    # server   server = function(input, output, session) {      # ... dealing renderbutton ...             addpopover(session=session, id="link", title="",                 content="testing.", placement = "bottom",                trigger = "click", options = null)    }) ) 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -